Skip to content

Instantly share code, notes, and snippets.

View MarianoGnu's full-sized avatar

Mariano Javier Suligoy MarianoGnu

View GitHub Profile
func pack(v: Array[bool) -> int:
var r: int = 0
for i in v.size():
r |= (1 << i) * int(v[i])
func unpack(v: int, size: int) -> Array[bool]
var r: Array[bool] = []
r.resize(size)
for i in size:
r[i] = bool(v & (1 << i))
class_name TilemapSaver
## Converts Node2D and it's TileMapLayer children to a PackedScene
static func pack_tilemaps(parent_node: Node2D) -> PackedScene:
for child in parent_node.get_children():
if child is TileMapLayer:
child.owner = parent_node
var packed := PackedScene.new()
var result = packed.pack(parent_node)
if result == OK:
@tool
class_name EnemyEntity extends CharacterBody2D
@export_custom(PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR) var _ai_cache: Dictionary
@onready var behaviour_tree_player: BTPlayer = get_node_or_null("BTPlayer")
@onready var blackboard_plan: BlackboardPlan = \
null if behaviour_tree_player == null else behaviour_tree_player.blackboard_plan
# more stuff
@tool
extends EditorPlugin
const MODULES_PATH = "res://modules/"
const SETTING_GODOT_CPP_PATH = "gd_extensions/build_tool/godot_cpp_path"
const SETTING_GENERATE_VSPROJ = "gd_extensions/build_tool/generate_vsproj"
const SETTING_EXTRA_BUILD_ARGS = "gd_extensions/build_tool/extra_build_args"
var godot_cpp_path : String
20:19:06: Running steps for project godot...
20:19:06: Starting: "C:\Python27\Scripts\scons.bat" platform=windows -j8 vsproj=yes target=debug
scons: Reading SConscript files ...
Configuring for Windows: target=debug, bits=default
Found MSVC compiler: amd64_x86
Compiled program architecture will be a 32 bit executable. (forcing bits=32).
YASM is necessary for WebM SIMD optimizations.
WebM SIMD optimizations are disabled. Check if your CPU architecture, CPU bits or platform are supported!
Checking for C header file mntent.h... (cached) no
scons: done reading SConscript files.
[{
"id": 1,
"type": "WEAPON",
"name": "Photon Gun",
"icon": "res://game_data/items/icons/photon_gun_a.svg",
"mesh": "res://scenes/items/weapons/photon_gun_a.tscn",
"bone": "mixamorig_RightHand",
"costs": {
"equip": 0,
"action": 1
extends Node
const src_path : String = "res://game_data";
var data : Dictionary = {}
func _init():
print("initialize_game_data")
load_data_from_files(src_path)
extends Node
var move_cmd_class = preload("res://singletons/battle_commands/move_to.gd")
var attack_cmd_class = preload("res://singletons/battle_commands/attack.gd")
export (Texture) var icon_punch_fwd
export (Texture) var icon_punch_bwd
export (Texture) var icon_punch_up
export (Texture) var icon_punch_down
export (Texture) var icon_swich_field
extends Node
func _ready():
var url = "http://zerosploit-api.herokuapp.com/servers.json"
var response = yield($HTTPRequest.request_url(url), "completed")
# execution will pause until request finishes
# response is now a dictionary or array, depending on the API result
pass
extends HTTPRequest
var last_response = null
func _ready():
# connect signal to catch body
self.connect("request_completed", self, "_on_HTTPRequest_request_completed")
func request_url(url):
self.request(url) # request to REST API