Skip to content

Instantly share code, notes, and snippets.

View Frontrider's full-sized avatar

Frontrider

  • Deutsche Telekom AG@telekom
  • Somewhere, far away
View GitHub Profile
@jules-goose
jules-goose / autotiler.gd
Created June 28, 2021 15:11
a proof of concept (and limited in functionality) gridmap autotiler for godot
tool
extends GridMap
#based on https://gamedevelopment.tutsplus.com/tutorials/how-to-use-tile-bitmasking-to-auto-tile-your-level-layouts--cms-25673 tutorial
# and using a 47 tile meshlibrary like this one : https://imgur.com/yuprM0n
var tilebitmask = { "254": 45, "90": 22, "22": 7, "0": 47, "10": 3, "2": 1, "94": 24, "120": 29, "11": 4, "208": 34, "107": 28, "82": 19, "216": 37, "86": 20, "223": 41, "214": 36, "104": 26, "222": 40, "74": 16, "18": 6, "8": 2, "248": 42, "255": 46, "127": 33, "123": 31, "66": 14, "16": 5, "219": 39, "75": 17, "80": 18, "122": 30, "30": 11, "126": 32, "31": 12, "250": 43, "88": 21, "64": 13, "95": 25, "251": 44, "91": 23, "24": 8, "27": 10, "218": 38, "72": 15, "106": 27, "26": 9, "210": 35 }
var bitmask = [
[1,2,4],
shader_type canvas_item;
uniform sampler2D spritesheet; // Should be a slice image as exported from Magica Voxel
uniform int slice_count = 1; // The number of slices
uniform vec2 camera_vec = vec2( 1., 1. ); // Recomend using (1,1) or (1,1.5)
uniform float camera_ang = 0.0; // change this to change the view angle of the object
const vec2 center = vec2( 0.5 );
bool scale_and_rotate_with_offset( inout vec2 uv, vec2 sxy, float ang, vec2 cent, vec2 offset )
@RainWarrior
RainWarrior / grammar.js
Last active January 27, 2022 10:35
Animation State Machine grammar
{
"parameters": { "name": <time_value>, ... },
"clips": { "name": <clip>, ... },
"states": [ "name", ... ],
"transitions": { "name_from": "name_to", ... },
"start_state": "name"
}
<time_value> ::=
<number> // result = number; Constant value.
@Crydust
Crydust / Git.java
Last active July 4, 2024 04:12
run git commands from java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Objects;