Skip to content

Instantly share code, notes, and snippets.

View btzr-io's full-sized avatar
🎯
Focusing

Baltazar Gomez btzr-io

🎯
Focusing
View GitHub Profile
@btzr-io
btzr-io / get_bounds.gd
Last active September 2, 2022 07:34
Get bounds from a group of nodes
enum EDGE { LEFT = -1, RIGHT = 1, TOP = -1, BOTTOM = 1, FAR = -1, NEAR = 1 }
func get_edge_position(target, direction_x = EDGE.LEFT, direction_y = EDGE.TOP ):
var edge = target.global_position
var half_size = target.get_current_size() / 2
edge.x += half_size.x * direction_x
edge.y += half_size.y * direction_y
return edge
func compare_edge(target, edge, distance = EDGE.NEAR):
@btzr-io
btzr-io / Connection_manager.gd
Last active August 31, 2022 08:02
Relationship / Connection manager
class Connection_manager:
# State / cache
var connections = {}
var memoized_hash = 0
var memoized_input_connections = {}
# Events
signal on_connection_added
signal on_connection_removed
func has(target, origin):
@btzr-io
btzr-io / History_manager.gd
Last active September 2, 2022 04:59
History manager ( Undo / Redo )
class History_manager:
var history = []
var pointer = -1
var max_size = 5
var has_undo = false
var has_redo = false
var action_after_undo = false
signal history_change
func _init(new_max_size = 5):
extends Spatial
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
export var speed = 0.4
export var max_speed = 1.8
@btzr-io
btzr-io / gwj41-document.md
Created January 17, 2022 06:04
GWJ 41 Document

Characters

  • Crab:
  • Golden fish:
  • Seal ?
@btzr-io
btzr-io / narrative.md
Last active November 3, 2018 20:10
Github game off 2018

Narrative elements

  • Title: Random gun
  • Theme: Sci-Fi, comedy (funny)
  • Setting: Secret lab from company X (some unkown place)
  • Main Character: Frank is the janitor
  • Characters: Security guards, robots maybe other scientist, Big monster ( to be decided ).

Plot

  • a
  • b
  • c
alert('testing...);
@btzr-io
btzr-io / csvify.js
Last active April 28, 2018 02:10
CSV Parser
const parseCsv = (data, filters = []) => {
// Get items for header
const getHeaders = item => {
const list = [];
// Apply filters
Object.entries(item).forEach(([key]) => {
if (!filters.includes(key)) list.push(key);
});
// return headers
@btzr-io
btzr-io / linux.showItemInFolder.js
Last active September 24, 2017 01:12
Electron -> shell -> showItemInFolder ( linux )
// Linux patch for electron: shell.showItemInFolder
const { execFile } = require('child_process');
// Parse application name
//https://gist.github.com/btzr-io/abb2f2995a63c08bbdc655d9849c69ff
const parseName = (name) => name.replace(/\s+/g, '')
.split(".")
.filter( key => key !== "org" && key !== "desktop")
.join("-");