Skip to content

Instantly share code, notes, and snippets.

View realkotob's full-sized avatar

Kotob realkotob

View GitHub Profile
@realkotob
realkotob / build.gd
Created January 10, 2023 18:21 — forked from imjp94/build.gd
Build script to help exporting Godot project.
tool
extends SceneTree
const PLATFORM_ANDROID = "Android"
const PLATFORM_HTML5 = "HTML5"
const PLATFORM_IOS = "iOS"
const PLATFORM_LINUX = "Linux/X11"
const PLATFORM_MAC = "Mac OSX"
const PLATFORM_UWP = "UWP"
const PLATFORM_WINDOWS = "Windows Desktop"
# Aliases
alias gg='git finish'
alias g='git'
alias gst='git status'
alias gd='git diff'
alias gdc='git diff --cached'
alias gl='git pull'
alias gup='git pull --rebase'
alias gp='git push'
@realkotob
realkotob / snapshot_sprite.gd
Created July 14, 2020 15:11 — forked from jshorty/snapshot_sprite.gd
Sprite that "snapshots" a Polygon2D for rendering performance
extends Sprite
# This dictates the size of the viewport used for the "snapshot".
export var source_image_size : Vector2
export var polygon : PoolVector2Array
func _ready():
var viewport_container = ViewportContainer.new()
viewport_container.set_size(source_image_size)
add_child(viewport_container)
@realkotob
realkotob / link_parser.gd
Created April 14, 2020 21:08 — forked from Darenn/link_parser.gd
A very simple #gdscript class to parse custom commands on an #Ink script, a narrative script language made by @inkleStudios. It also converts custom inline tags to support text formatting.
@realkotob
realkotob / godot_async_scene_loader.gd
Created January 10, 2020 18:30 — forked from NovemberDev/godot_async_scene_loader.gd
Asynchronously loads scenes in godot
# Loads a scene in the background using a seperate thread and a queue.
# Foreach new scene there will be an instance of ResourceInteractiveLoader
# that will raise an on_scene_loaded event once the scene has been loaded.
# Hooking the on_progress event will give you the current progress of any
# scene that is being processed in realtime. The loader also uses caching
# to avoid duplicate loading of scenes and it will prevent loading the
# same scene multiple times concurrently.
#
# Sample usage:
#
@realkotob
realkotob / LevelLoader.gd
Created January 10, 2020 18:30 — forked from Janglee123/LevelLoader.gd
Godot Level Loader
extends Node
onready var scene_tree: = get_tree()
var _path: = "res://src/Levels/Levels/"
var _levels: = []
var _level_index: = -1
var _level
var _container
@realkotob
realkotob / easing.py
Created October 30, 2019 15:58 — forked from th0ma5w/easing.py
Easing Equations in Python (orig by Robert Penner)
# ported from http://www.gizma.com/easing/
# by http://th0ma5w.github.io
#
# untested :P
import math
linearTween = lambda t, b, c, d : c*t/d + b
extends RayCast2D
# If this is use to disable collisions
export(bool) var disable_collisions = false;
# What to set/remove collisions against
export(NodePath) var physics_path
var physics_object
func _ready():