Skip to content

Instantly share code, notes, and snippets.

View swarnimarun's full-sized avatar
🎣
fishing for some fun.

Swarnim Arun swarnimarun

🎣
fishing for some fun.
View GitHub Profile
@swarnimarun
swarnimarun / github_action_cpp_notes.md
Last active July 3, 2020 22:46
useful github actions for cpp projects

Proposal for Changes to Visual Scripting System

AIMS OF THE PROPOSAL

  • Moving towards modularity
  • Simplification and accessility for customization of the scripting system
  • Reloadable and Debuggable chunks
  • Cleaner and robust utilities while scripting

Primary Idea: Adding reusable Sub-Graphs/Scriptables to the Scripting System

@swarnimarun
swarnimarun / infinite_yield.gd
Last active June 5, 2019 16:17
Yield as the ultimate coroutine
extends Node
func yielder():
print("Holla")
yield()
return yielder()
func returny_yielder():
print(yield())
return returny_yielder()
@swarnimarun
swarnimarun / notification.gd
Last active June 5, 2019 16:34
Using Yield GDScript for a Notifier Model
extends Node
## NOTIFIER MODEL
class MyNotifier extends Object:
signal poke
func poke():
# this can even take arguments if you want to pass some
emit_signal("poke", "hello", "hi")
@swarnimarun
swarnimarun / loop_yield.gd
Created June 5, 2019 11:11
Yield GDScript Simple quiz
extends Node
func my_looper():
for x in 4:
yield()
print("I am %sx awesome" % x)
func _ready():
var v = my_looper()
@swarnimarun
swarnimarun / return_yield.gd
Last active June 5, 2019 10:53
Examples of Yield Function uses in GDScript
extends Node
func my_yielding_function():
print("Hello")
print(yield())
print("World")
func _ready():
var v = my_yielding_function()
v.resume("Awesome")
@swarnimarun
swarnimarun / tileset_generator.gd
Created August 14, 2018 19:11
Code from my video tutorial I made for auto-generation of Tilesets
tool
extends Node
export(Texture) var texture
export var tileSize = Vector2(16, 16)
export var tiles_to_map = Vector2(0, 0)
export var generate = false
export(Script) var gen_script
func _process(delta):
shader_type canvas_item;
render_mode unshaded;
uniform sampler2D tex : hint_albedo;
uniform float deform_amt : hint_range(-1,1);
uniform float deform_speed : hint_range(0.5,4);
uniform bool animate;
void fragment() {
float def_amt = deform_amt;