Skip to content

Instantly share code, notes, and snippets.

View GammaGames's full-sized avatar
🎃
👉😎👉 zoop

Jesse GammaGames

🎃
👉😎👉 zoop
View GitHub Profile
@noidexe
noidexe / RoundRobinPlayer.gd
Created September 9, 2019 07:00
RoundRobinPlayer node for Godot Engine with sequence, random, and shuffle modes extending AudioStreamPlayer
tool
extends AudioStreamPlayer #exactly the same code should work for extending 2D and 3D versions
class_name RoundRobinPlayer
export(int, "sequence", "random", "shuffle") var queue_mode = 0
export(Array, AudioStream) var playlist = [] setget _set_playlist, _get_playlist
export(bool) var round_robin_playing = false setget _set_playing, _is_playing # can't override properties so use this for animations
var playlist_index = -1 # current position in the playlist
var shuffled_indices = [] # Array<int> of shuffled playlist indices
shader_type spatial;
uniform sampler2D noise;
uniform float noise_cutoff = 0.7;
uniform vec4 depth_gradient_shallow : hint_color = vec4(0.325, 0.807, 0.971, 0.725);
uniform vec4 depth_gradient_deep : hint_color = vec4(0.086, 0.407, 1, 0.749);
uniform vec4 foam_color : hint_color = vec4(1.0, 1.0, 1.0, 1.0);
uniform float depth_max_distance = 1.0;
@peteruithoven
peteruithoven / quarter-tiler
Last active March 2, 2023 06:31
Crude quarter tiling tool for elementary OS
#!/bin/bash
# Crude quarter tiling tool
# Installation:
# Move file to: /usr/local/bin/quarter-tiler
# Make executable: sudo chmod +x /usr/local/bin/quarter-tiler
# Assign keyboard shortcuts to commands like "quarter-tiler topleft"
# Margins around windows (elementary OS native apps) (HiDPI)
MARGIN_TOP=130
@PrestonKnopp
PrestonKnopp / optional.gd
Last active September 20, 2023 21:15
Attempt at Optionals in GDScript
# optional.gd
#
# Caveat
# ------
# This only works with types inheriting from Object. Built-in types don't work
# with the call api. Built-ins can still be fetched but they cannot be operated
# on.
#
# This can be fixed by subclassing optional and adding type specific methods
# that wrap the builtin type.
@GammaGames
GammaGames / .bashrc
Last active June 10, 2020 17:33
~/.bashrc
export EDITOR=vim
fortune | cowsay -f duck | lolcat
alias grit=". /home/$USER/Documents/grit/grit"
alias please='sudo $(fc -ln -1)'
alias pyss="python3 /home/$USER/Documents/pyss/pyss.py"
alias serv='python3 -m http.server'
alias timer='echo "Ctrl+C to stop"; time cat'
alias upt='sudo apt update && apt list --upgradable'
alias calc='bc'
alias c='code'
@EIREXE
EIREXE / Godot Minimap.md
Last active April 1, 2022 09:35
Automatic minimap generation in godot

Building an automated map/minimap system in Godot

Why?

Our game, ERO-ONE needed a minimap system, it being an open world game made this a necessity, otherwise the player wouldn't really know where he's going.

Of course making a proper minimap is hard, we told ourselves that our game didn't really need it because it's not as big as the open world powerhouse that is Grand Theft Auto, but the real reasons are...

shader_type canvas_item;
render_mode unshaded;
uniform sampler2D tex : hint_albedo;
uniform float deform_amt : hint_range(-1,1);
uniform float deform_speed : hint_range(0.5,4);
uniform bool animate;
void fragment() {
float def_amt = deform_amt;
@atomius0
atomius0 / PixelPerfectScaling.gd
Created March 12, 2018 16:29
Pixel-Perfect scaling script, ported to Godot 3.
# original code by CowThing: https://github.com/godotengine/godot/issues/6506
# port to Godot 3 and bugfixes by atomius.
# usage:
# set this script as AutoLoad (Singleton enabled)
#
# in the project settings:
# [display]
# set 'window/size/width' and 'window/size/height' to your desired render resolution.
# set 'window/size/test_width' and 'window/size/test_height' to the initial window size.
#!/usr/bin/env python
'''Crop an image to just the portions containing text.
Usage:
./crop_morphology.py path/to/image.jpg
This will place the cropped image in path/to/image.crop.png.
For details on the methodology, see
@aubricus
aubricus / License
Last active June 20, 2023 01:19
Python Progress Bar
Copyright 2020 Aubrey Taylor
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTH