Skip to content

Instantly share code, notes, and snippets.

View Razzlegames's full-sized avatar

Kyle Luce Razzlegames

View GitHub Profile
@Razzlegames
Razzlegames / bubble.glsl
Last active October 29, 2023 22:59
Shader with faked refraction, inverted screen lookup and larger screen read
shader_type canvas_item;
uniform float refractionMagnitude = 30.0;
uniform float captureMagnitude = 0.0;
void fragment() {
// Possibly a more acturate way to do refraction? Uncomment and see how you like it (and comment out below refraction)
//vec3 refraction = -refract(vec3(0,0,-1), texture(NORMAL_TEXTURE, UV).rgb, 1.1) *2.0;
vec3 refraction = - texture(NORMAL_TEXTURE, UV).rgb * vec3(1.0,-1.0,1.0);
export var viewportResizeStanddown = 0.5
var viewportResizeCounter = 0.0
signal settingsChanged()
signal particlesSettingsChanged()
signal removeGpuParticles()
func forbidParticles(time):
particlesForbiddenCounter = time
particlesForbidden = true
a = []
b = a
a.append(6)
print("a = " + str(a))
print ("b = " + str(b))
# output:
# a = [6]
@Razzlegames
Razzlegames / testLerpVsMoveToward.gd
Last active December 28, 2021 18:03
Help explain difference between Godot's `lerp` and `move_toward`
extends "res://addons/gut/test.gd"
func test_lerp():
var a = Vector2(0, 2)
var b = Vector2(0, 0)
var lerped = lerp(a, b, 0.5)
assert_eq(Vector2(0, 1), lerped)
@Razzlegames
Razzlegames / RunAllIntegrationTests.gd
Last active October 9, 2021 19:48
Run all integration tests using Yield to wait for test completion before running next test
extends Node
export(String, DIR) var testsPath
var sceneList = []
var allErrors = []
onready var assertTool = Assert.new(get_script().get_path())
func _ready():
_connectSignals()
@Razzlegames
Razzlegames / Progress.gd
Created December 22, 2020 00:38
Example using progress bar
extends TextureProgress
onready var Signals = get_node("/root/Signals")
func _ready():
Signals.connect(Signals.UPDATE_ENERGY_EVENT_NAME, self, "updateValue")
#self.size_flags_vertical |= SIZE_EXPAND
func _draw():
@Razzlegames
Razzlegames / compile.log
Created December 19, 2020 16:01
use_mingw=true does nothing for compiling godot-cpp bindings, even though g++/Mingw in PATH
PS C:\Users\razzl\Development\Godot\gdnative_cpp_example\godot-cpp> scons platform=windows generate_bindings=yes -j4 use_mingw=yes
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cl /Fosrc\core\AABB.obj /c src\core\AABB.cpp /TP /nologo /EHsc /D_DEBUG /MDd /I. /Igodot_headers /Iinclude /Iinclude\gen /Iinclude\core
AABB.cpp
cl /Fosrc\core\Array.obj /c src\core\Array.cpp /TP /nologo /EHsc /D_DEBUG /MDd /I. /Igodot_headers /Iinclude /Iinclude\gen /Iinclude\core
cl /Fosrc\core\Basis.obj /c src\core\Basis.cpp /TP /nologo /EHsc /D_DEBUG /MDd /I. /Igodot_headers /Iinclude /Iinclude\gen /Iinclude\core
cl /Fosrc\core\Color.obj /c src\core\Color.cpp /TP /nologo /EHsc /D_DEBUG /MDd /I. /Igodot_headers /Iinclude /Iinclude\gen /Iinclude\core
Array.cpp
@Razzlegames
Razzlegames / godot-cpp_Bindings_compile_failure.log
Last active December 19, 2020 15:36
Godot-CPP Bindings fails to build with Visual Studio 2019 compiler (with default godot_api.json)
PS C:\Users\razzl\Development\Godot\gdnative_cpp_example\godot-cpp> scons platform=windows generate_bindings=yes
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cl /Fosrc\core\AABB.obj /c src\core\AABB.cpp /TP /nologo /EHsc /D_DEBUG /MDd /I. /Igodot_headers /Iinclude /Iinclude\gen /Iinclude\core
AABB.cpp
cl /Fosrc\core\Array.obj /c src\core\Array.cpp /TP /nologo /EHsc /D_DEBUG /MDd /I. /Igodot_headers /Iinclude /Iinclude\gen /Iinclude\core
Array.cpp
cl /Fosrc\core\Basis.obj /c src\core\Basis.cpp /TP /nologo /EHsc /D_DEBUG /MDd /I. /Igodot_headers /Iinclude /Iinclude\gen /Iinclude\core
Basis.cpp
@Razzlegames
Razzlegames / Makefile
Created October 17, 2020 20:51
Makefile for PSP project
TARGET = RazzlePuzzle
#---------------------------------------------------------------------------------
# Icon and picture for your game in menu
#---------------------------------------------------------------------------------
# Uncomment and change to your picture name
#PSP_EBOOT_PIC1 = PIC1.PNG
#PSP_EBOOT_ICON = ICON0.PNG
# Build a PRX file
#!/bin/perl
$num = 4;
sub a {
return $num
}
sub b {