Skip to content

Instantly share code, notes, and snippets.

@belzecue
belzecue / LinkedList.gd
Last active November 11, 2023 19:25 — forked from bojidar-bg/LinkedList.gd
Doubly Linked List for Godot
# Linked List
# from https://gist.github.com/bojidar-bg/a570c614a4dd1cd84949
# Example use
"""
var my_linked_list = LinkedList.new()
func _ready():
var ll = my_linked_list
@belzecue
belzecue / RingBufferDic.gd
Created February 24, 2022 15:54
Godot ring buffer using Dictionary. Can pop FIFO or LIFO.
class_name RingBufferDic extends Node
enum PopMode {LIFO, FIFO}
export(int) var maxHistoryEntries := 32
var history := {}
var hwm := 0 # high water mark
var LIFO := -1 # -1 means buffer empty
var FIFO := -1 # -1 means buffer empty
var pop_counter := 0
export var viewportResizeStanddown = 0.5
var viewportResizeCounter = 0.0
signal settingsChanged()
signal particlesSettingsChanged()
signal removeGpuParticles()
func forbidParticles(time):
particlesForbiddenCounter = time
particlesForbidden = true
@belzecue
belzecue / gist:96dad64d48389eda4900cf773135ea0e
Created July 5, 2021 17:58
Unity - UV animation/distortion shader
Shader "Uber Animation Shader" {
Properties {
[Header(Main)]
_MainTex("Albedo (RGB)", 2D) = "white" {}
_MainBumpMap("Normal", 2D) = "bump" {}
[ToggleOff] _StaticBump("Static Bump Map", Float) = 1.0
_MainTexScale("MainTex Scale", float) = 0.0
_TexMColor("Color", Color) = (1,1,1,1)
_TexMColorBoost("Color Boost", Range(-1,1)) = 0.0
@belzecue
belzecue / CharRigidBody.gd
Last active August 14, 2023 18:36
The ONLY guaranteed solution to physics body jitter in Godot - separate your physics body from its visual representation. Works with 3D too, but smoothing is now built into Godot for 3D (not yet built in for 2D).
class_name CharRigidBody extends RigidBody2D
# Your visual representation node, e.g. Sprite
export(NodePath) var visual_body_path: NodePath
# For RigidBody tweening
var physics_body_trans_last: Transform
var physics_body_trans_current: Transform
var debug: bool = true
@belzecue
belzecue / DoomGlow.cs
Created April 25, 2023 02:34 — forked from TiliSleepStealer/DoomGlow.cs
Doom glow - fake volumetric light glow effect in Unity by Tili_us
// This file is in the public domain. Where
// a public domain declaration is not recognized, you are granted
// a license to freely use, modify, and redistribute this file in
// any way you choose.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// Unity remake of a fake volumetric light glow effect
@belzecue
belzecue / gist:4e4f64a579037e5b9c1088a9b7e82a1a
Created February 9, 2023 04:06 — forked from WolfgangSenff/gist:0a9c1d800db42a9a9441b2d0288ed0fd
GDScript 1.0 to 2.0 Beginner Friendly Conversion Guide
Beginner-friendly GDScript 1 to GDScript 2 Conversion Guide
First and foremost, this should not be considered a replacement for the official migration guide,
found at https://docs.godotengine.org/en/latest/tutorials/migrating/upgrading_to_godot_4.html!
Instead, this document is intended to be a friendly guide to helping you upgrade your projects from
GDScript 1 to 2. To do this, I'm going to list the most common conversions I've run into while upgrading
a few of my games and tools. This document is written as of the first release candidate version of Godot 4.0.
The first thing to do when converting a project (no need if you're starting from new) is to either have your
project in source control, or make a duplicate of your entire project's folder and rename it. This will
@belzecue
belzecue / ad.md
Created January 7, 2023 18:55 — forked from rosswd/ad.md
Install Quake and the Arcane Dimensions Mod on a modern Windows system

How to Install Quake and the Arcane Dimensions Mod

Assumptions

This guide assumes you're using Windows 10 and the Steam version of Quake. Although it might work for other systems I don't have access to said systems. We will use Quakespasm as the Quake Engine.

Install Quake

  • Download and Install Quake from Steam
  • You can also install Mission Pack 1: Scourge of Armagon and Mission Pack 2: Dissolution of Eternity, if you like. Scourge of Armagon is seen as the better of the two.

Install the Soundtrack

@belzecue
belzecue / build.gd
Created January 7, 2023 14:57 — forked from imjp94/build.gd
Build script to help exporting Godot project.
tool
extends SceneTree
const PLATFORM_ANDROID = "Android"
const PLATFORM_HTML5 = "HTML5"
const PLATFORM_IOS = "iOS"
const PLATFORM_LINUX = "Linux/X11"
const PLATFORM_MAC = "Mac OSX"
const PLATFORM_UWP = "UWP"
const PLATFORM_WINDOWS = "Windows Desktop"
@belzecue
belzecue / MatchRectSize.gd
Created November 2, 2022 14:07 — forked from jasonwinterpixel/MatchRectSize.gd
Godot Match Rect Size
tool
extends Node
class_name MatchRectSize
onready var parent := get_parent() as Control
export(NodePath) var target_control
onready var target := get_node(target_control) as Control
export var match_x := true
export var match_y := true