Skip to content

Instantly share code, notes, and snippets.

View tudddorrr's full-sized avatar

tudor tudddorrr

View GitHub Profile
[gd_scene load_steps=2 format=3 uid="uid://cbmprpim3xigq"]
[ext_resource type="Script" path="res://addons/talo/samples/saves_tutorial.gd" id="1_r0iv1"]
[node name="SavesTutorial" type="Node2D"]
script = ExtResource("1_r0iv1")
[node name="Control" type="Control" parent="."]
layout_mode = 3
anchors_preset = 8
@tudddorrr
tudddorrr / Example.js
Created April 7, 2021 07:52
react table components
<table className='table-auto w-full'>
<TableHeader columns={['Aliases', 'Properties', 'Registered', 'Last seen']} />
<TableBody iterator={players}>
{(player) => (
<>
<TableCell><PlayerAliases aliases={player.aliases} /></TableCell>
<TableCell>
<div className='flex items-center'>
<span className='min-w-5'>{Object.keys(player.props).length}</span>
<Button
@tudddorrr
tudddorrr / DirtFragment.cs
Created December 22, 2019 19:51
Old way of doing serialisable world objects
public class DirtFragment {
public string Id { get; set; }
public float FertilisationFactor { get; set; }
public int ChanceToFind { get; set; }
public float X { get; set; }
public float Y { get; set; }
public static object Deserialize(byte[] data) {
DirtFragment result = new DirtFragment();
using (MemoryStream m = new MemoryStream(data)) {
@tudddorrr
tudddorrr / WorldGenerator2.cs
Created August 19, 2019 16:54
Chunks based world generation for Crawle 2
using UnityEngine;
using Photon.Pun;
using System.Collections.Generic;
using Pathfinding;
using System.Linq;
using ExitGames.Client.Photon;
using System.Collections;
public class WorldGenerator : MonoBehaviour {
public static System.Random rng, masterRng;
@tudddorrr
tudddorrr / WorldGenerator.cs
Created August 7, 2019 20:30
Crawle 2 - WorldGen v1.0
using UnityEngine;
using Photon.Pun;
using System.Collections.Generic;
using Pathfinding;
using System.Linq;
using ExitGames.Client.Photon;
public class WorldGenerator : MonoBehaviour {
public static System.Random rng, masterRng;
public static float worldSize;