Skip to content

Instantly share code, notes, and snippets.

View waimus's full-sized avatar

waimus waimus

View GitHub Profile
@waimus
waimus / StandaloneTimer.cs
Last active April 18, 2025 08:19
A component mimicking the behaviour of Godot Engine's Timer node in a simple way. Written for Unity C#
/*
* StandaloneTimer.cs
* A component mimcking the behaviour of Godot Engine's
* Timer node in a simple way. Written for Unity C#.
*
* LICENSE
*
* Copyright 2022-2025 waimus
*
* Permission is hereby granted, free of charge, to any person
@waimus
waimus / json_parse_build.vala
Created July 4, 2022 11:23
Vala: build & parse rough example.
// valac --pkg json-glib-1.0 json_parse_build.vala
using Json;
const string JSON_PATH = "/path/to/file.json";
int main() {
build_example();
read_example();
return 0;
}
@waimus
waimus / kinematicbody_jump.gd
Created August 23, 2022 12:20
The idea is to have easy jump and quick fall. E.g. by lowering the gravity during jump and doubling the gravity during fall (which detected by `velocity.y < 0`).
# No warranty to immediately work. May need additional configuration
export(float) var jump_height : float = 64.0
var world_gravity : Vector3 = Vector3.DOWN * 10.0
var move_velocity : Vector3 = Vector3.ZERO
# Handle player jump movement implenented with KinematicBody
func action_input_jump(delta : float) -> void:
world_gravity = Vector3.DOWN * 10