Skip to content

Instantly share code, notes, and snippets.


Lisandro Lorea noidexe

View GitHub Profile
noidexe /
Last active Aug 17, 2020
User icon.png as Audio
extends AudioStreamPlayer
# "We were so preoccupied with whether or not we could, we didn’t stop to think if we should."
var sample_hz = 8000.0 # Adjust and enjoy the sound of nightmares
var playback: AudioStreamPlayback = null # Actual playback stream, assigned in _init().
var _stream = PoolRealArray()
var stream_pos = 0
noidexe / Godot_unstable.svg
Last active Feb 28, 2020
Godot icon with alternative palette to differentiate from stable in desktop shortcuts
View Godot_unstable.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
noidexe /
Created Sep 9, 2019
RoundRobinPlayer node for Godot Engine with sequence, random, and shuffle modes extending AudioStreamPlayer
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
noidexe /
Created Dec 28, 2017
ShuffleBag implementation in gdscript
#You can add this to any singleton where you have helper classes and functions
class ShuffleBag:
var _shuffled_list
var _current_pos = -1
func _init(array_from):
var _unshuffled = array_from.duplicate()
var _shuffled = []
var _current_pos
# Pick a random element from the unshuffled list
noidexe / script.cs
Created Oct 12, 2017
Godot sample script: GDScript vs C#
View script.cs
using Godot;
using System;
public class SharpBird : Node2D
// Member variables here, example:
// private int a = 2;
// private string b = "textvar";
private double direction;
Random r = new Random();
noidexe /
Last active Oct 20, 2017
Drag n Drop example in Godot
extends Node2D
signal picked
signal dropped
var drag_state = DRAGSTATES.DROPPED
var prev_mouse_pos = Vector2(0,0)
var absolute_z = IntArray([0])
var last_event
noidexe / joycon-mappings.txt
Created Jul 31, 2017
Nintendo Switch Joycons as html5 bluetooth controller
View joycon-mappings.txt
Nintendo Switch Joycons use standard bluetooth technology and can be paired with a PC or phone by holding the power button between SL and SR while the console is off.
If your Switch can't find em after that just reattach them to the console and they'll pair up immediately.
Button scheme info obtained using and
Joycon R: Wireless Gamepad (Vendor: 057e Product: 2007)
Switch, Generic, XBOX
SL, B4, LB
SR, B5, RB
noidexe / PyxelEdit-LicenseFix.cmd
Last active May 11, 2017
Pyxel Edit License Fix (Windows)
View PyxelEdit-LicenseFix.cmd
@echo OFF
echo.Gist at
echo.Remember to run as admin
set licensefile="C:\Program Files\PyxelEdit\Settings\LicenseKey.txt"
set licensefilex64="C:\Program Files (x86)\PyxelEdit\Settings\LicenseKey.txt"
set exepath="C:\Program Files\PyxelEdit\PyxelEdit.exe"
View Iterador.cmd
REM Reemplaza las lineas echo por el comando del conversor
REM Copia este archivo a la carpeta donde esten los wavs y ejecutalo
@echo off
for %%f in (*.wav) do call:mifuncion %%f
echo.aca se convertiria %1 a mp3
echo.aca se convertiria %1 a ogg
noidexe / build-spigot-update.ps1
Created Mar 14, 2015
Script to build Spigot on windows using PowerShell
View build-spigot-update.ps1
#To use just do: [Right Click]->[Run in PowerShell]
$source = ""
#Once the new BuildTools are out of beta chage the url above to:
$destination = "BuildTools.jar"
Invoke-WebRequest $source -OutFile $destination