Skip to content

Instantly share code, notes, and snippets.

View EIREXE's full-sized avatar

Álex Román Núñez EIREXE

View GitHub Profile
@EIREXE
EIREXE / README.md
Last active May 19, 2023 09:22
How to use the Shinobu audio engine.

Shinobu is my custom audio engine for Godot based on the great miniaudio library.

This audio engine doesn't behave like Godot's audio engine, so I thought it would be nice to write some documentation to explain the basic gist of it.

Audio node system

Unlike godot's audio bus system, shinobu uses miniaudio's audio node system, this is much more powerful but might be harder to use.

Usage

@EIREXE
EIREXE / RangeDownloader.gd
Last active July 19, 2022 21:41
Godot HTTP "Range" based file downloader
class_name HBHTTPRangeDownloader
signal download_finished
enum STATE {
STATE_READY,
STATE_BUSY
}
var download_url := ""
@EIREXE
EIREXE / publish.py
Last active November 15, 2020 03:53
import argparse
parser = argparse.ArgumentParser(description='Builds PH')
parser.add_argument("--master", default=argparse.SUPPRESS)
args = parser.parse_args()
PROJECT_DIR="/home/eirexe/Project Heartbeat/Project Heartbeat"
@EIREXE
EIREXE / Generic Apology Text.md
Last active October 15, 2024 04:54
Generic Apology Text: Feel free to use this in case some twitter idiot tries to cancel you over some inconsequential thing.

I'm sure you've all heard about the recent allegations against me, and I knew I couldn't stay silent about this any longer. It's time to finally come clean and explain exactly what happened, and the steps that I'm taking to address the problem.

First of all, let me say that I am sorry. I know I fucked up, and I can't take back what I've done. I'm a human, and sometimes I make mistakes. That's not an excuse, but it is the truth. My heart goes out to the people that may or may not have been harmed by my actions. A number of people - I won't name names - have spoken out against what I've done, and they're right to do so. I deeply regret my actions, and while I don't expect them to forgive me, I do hope that the actions I've taken since to prevent this from happening again will help ease their suffering. I was in the wrong here, and they have every right to be angry at me. Are all of their accusations true? Who's to say. Many of the things they have allegedly claimed I have done may have been true, and many of t

# Base for any serializable object
class_name HBSerializable
var serializable_fields := []
func serialize():
if get_serialized_type():
var defaults = get_serializable_types()[get_serialized_type()].new()
var serialized_data = {}
for field in serializable_fields:
var _field = get(field)
# Interpolates from a to b along a sine wave
func sin_pos_interp(from: Vector2, to: Vector2, amplitude: float, frequency: float, value: float) -> Vector2:
var dist = (from - to).length()
value = clamp(value, 0, 1)
if dist != 0:
var t = value * dist
var x = t
var angle = from.angle_to_point(to)
var y = amplitude * sin((t/dist)*PI*frequency)
var xp = (x * cos(angle)) - (y * sin(angle))
@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 spatial;
render_mode shadows_disabled;
uniform float rim = 0.25;
uniform float rim_tint = 0.5;
uniform sampler2D albedo : hint_albedo;
uniform float specular;
uniform float roughness = 1.0;
uniform bool disable_lighting = false;
uniform vec4 shadow_color : hint_color;
tool
extends Control
export(float) var rotary_min_angle = -135.0 setget set_rotary_min_angle
export(float) var rotary_max_angle = 135.0 setget set_rotary_max_angle
export(float) var radius = 85.0 setget set_radius
const REFERENCE_WIDTH = 225
const ROTARY_BASE_WIDTH = 25.0
extends Node
var thread
var mutex
var sem
var time_max = 100 # msec
var queue = []
var pending = {}