Skip to content

Instantly share code, notes, and snippets.

View WuffMakesGames's full-sized avatar
👤
Starting new projects

WuffMakesGames WuffMakesGames

👤
Starting new projects
View GitHub Profile
@WuffMakesGames
WuffMakesGames / gc.gml
Last active July 16, 2026 11:55
Collection of garbage collection functions for GameMaker
/// Returns a binding for a specific variable name inside a struct
/// @arg {Struct} struct
/// @arg {String} name
/// @return {Struct.GCBinding}
function gc_bind(_struct, _name) {
if (!is_struct(_struct)) show_error($"Invalid type: {typeof(_struct)}. Expecting string", true)
if (!is_string(_name)) show_error($"Invalid type: {typeof(_name)}. Expecting string", true)
return new GCBinding(_struct, _name)
}
@WuffMakesGames
WuffMakesGames / raycaster.p8
Created September 3, 2024 18:23
My submission for the 2024 PICO-1K Game jam, a 3d raycaster engine and level editor
pico-8 cartridge // http://www.pico-8.com
version 42
__lua__
★={}px=64py=64pdir=.75po=0pbo=0shd=split("∧▒◆░░░░▤░▥░░░░░░░",1)for f=0,16do add(★,{rnd"128",rnd"64"})end poke(24405,0)for f=0,15do rectfill(f*8,0,f*8+7,8,f)end poke(24405,96)function play()if(btnp"5")_draw=edit
xinp=tonum(btn(1))-tonum(btn(0))yinp=tonum(btn(2))-tonum(btn(3))if(yinp~=0)pbo+=.08else po-=po*.2pbo=0
po=sin(pbo)pdir-=xinp*.01dx,dy=cos(pdir)*yinp*.5,sin(pdir)*yinp*.5if(mget((px+dx)/8,py/8)==0)px+=dx
if(mget(px/8,(py+dy)/8)==0)py+=dy
px=mid(px,1,127)py=mid(py,1,127)cls()circfill(pdir*256%256,16,5,7)foreach(★,function(f)?".",(f[1]+pdir*300)%128-2,f[2],7
end)rectfill(0,64,128,256,3)camera(0,po)❎(128,.45,12,32)camera()?"❎",0,0,7
end function edit()if(btnp"5")_draw=play