Skip to content

Instantly share code, notes, and snippets.

View erodozer's full-sized avatar
🚧
I may be slow to respond between 8am-8pm EST M-F

Nicholas Hydock / ero erodozer

🚧
I may be slow to respond between 8am-8pm EST M-F
View GitHub Profile

Godot Scene Manager

Simple scene manager with simple transition effects using RPG Maker greyscale images. Doesn't do async loading at all, but that's fine for small games that just want a little pizzaz to their visuals. Just drop the file into your project and add it to your Autoloads. Then start doing SceneManager.change_scene('res://myscene.tscn') instead of get_tree().change_scene('res://myscene.tscn') and you'll be good to go.

@erodozer
erodozer / SceneManager.gd
Last active September 27, 2018 01:59
Godot Scene Transition
extends Node
var next_scene = null
var is_ready setget _finish_transition
onready var anim = $Fader/AnimationPlayer
func _finish_transition(value):
if value:
is_ready = true
@erodozer
erodozer / consul_sanic_example.py
Last active February 27, 2018 20:07
Sanic Config loading with Consul
from sanic import Sanic
from consul.aio import Consul
import default_settings
import asyncio
"""
Initialize application
"""
@erodozer
erodozer / RedirectInput.cs
Last active December 20, 2017 04:17
Redirect Unity3D input into a letterboxed fixed area. Good for fixed resolution games with aspect ratio preserved scaling.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
public class RedirectInput : StandaloneInputModule {
// letterboxed fixed area
[SerializeField] Vector2 fixedResolution;
@erodozer
erodozer / RoguelikeTile.cs
Created December 20, 2017 03:41
Roguelike tile
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;
#if UNITY_EDITOR
using UnityEditor;
#endif
namespace Adventure.Tilemaps
@erodozer
erodozer / ECS.cs
Created December 10, 2017 03:24
Single file Simple C# Entity-Component-System inspired by Artemis/Ashley
using System;
using System.Collections.Generic;
/// <summary>
/// Very simple entity-component system
/// Provides just the basics, doesn't need to be very efficient because it's
/// most valuable for smaller games without a shit ton of entities
/// </summary>
namespace github.io.nhydock.ECS
{
@erodozer
erodozer / REDUX_CLASS_REDUCER
Last active August 18, 2017 02:05
OOP Redux
Simple function created so you can make reducers that are classes in ES6.
I did this because I found the switch-statement approach to be rather messy
once the action handling within the reducer gets substantially large.
@erodozer
erodozer / EventPool.java
Last active October 25, 2016 15:04
Event pool extending libgdx's reflection pool
public class EventPool extends SharedInheritenceReflectionPool<Event> {
public EventPool () {
this(16, Integer.MAX_VALUE);
}
public EventPool (int initialCapacity) {
this(initialCapacity, Integer.MAX_VALUE);
}
@erodozer
erodozer / 3ch.txt
Last active January 18, 2020 18:19
3ch Golf Language Specification
3ch Language Specification
***keywords***
always lower case
var - declare variable
val - declare constant
cls - class
slf - self (this)
sup - super
@erodozer
erodozer / rip_iso.sh
Created June 19, 2016 02:44
Stupid simple bash script for properly ripping PS2 dvds and naming them by their SLUS
#!/bin/sh
device='/dev/sr0'
mount=$(mount | grep $device | cut -d " " -f 3)
DVD_NAME=$(find $mount -name "SLUS_*" | grep -o '[^/]*$')
blockcount=$(isoinfo -d -i $device | grep "^Volume size is:" | cut -d " " -f 4)
blocksize=$(isoinfo -d -i $device | grep "^Logical block size is:" | cut -d " " -f 5)
dd if=$device bs=$blocksize count=$blockcount of=$DVD_NAME.iso