Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
A jam submission

1K Snow GlobeView game page

Somewhat Realistic Snow Globe with Dubious Math
Submitted by Jenny Schmidt (bikibird) — 2 days, 21 hours before the deadline
Add to collection

Play Fidget Toy

1K Snow Globe's itch.io page

Compressed Bytes used
846

Source Code (OPTIONAL)
function _init()o,a={},50n,l=a*a,-a camera(-64,-64)e={0x71.717,1905.06823,0x7.17,1809.06676,0x7.17,1905.06823,0x71.717,0,0x71.717,1905.44323,0x7.77,1911.46666,0x7.77,1905.44323,0x71.717}for n=0,15do poke4(n*64,e[n+1])end for n=1,150do add(o,d())end s,x,i,c=-.02,0,0,0end function _update60()if(btnp(🅾️))x+=2i=rnd{-.01,.01}
if(btnp(⬅️))i-=-.01
if(btnp(➡️))i+=.01
for n in all(o)do local o,e,l,c,d=n.x,n.y,n.z,c local c=atan2(o,l)local f=o*cos(c)+l*sin(c)o,l=f*cos(c+i),f*sin(c+i)d=n.dy+x+s e+=d if(u(o,e,l)<a)local c,f=h(o-3.5,e-3.5,l)local a,x=h(o+3.5,e+3.5,l)n.x,n.y,n.z,n.x0,n.y0,n.width,n.height,n.dy=o,e,l,c,f,c-a,f-x,d else if(e<0)n.dy=0else n.dy=-d
end x*=.9f=x>1and x*rnd{3,-3}\1or 0r=x*5for n=1,#o do local n=n while(n>1and not(o[n-1].z>o[n].z))o[n],o[n-1]=o[n-1],o[n]n=n-1
end end function _draw()cls()for o,n in pairs(o)do local o,l,n,e,d=n.x0,n.y0,n.width,n.height,0if(abs(n)<4or abs(e)<4)d=8
local c=pget(o+n/2,l+n/2)pal(1,c~=7and c or 0)sspr(0,d,7,7,o+f,l-r,n,e)end poke(24372,2)circfill(0-f,0-r,a,6144)poke(24372,0)circ(0-f,0-r,a,3)clip(0-f,64-r,128,64)circ(0-f,0-r,a-1,3)clip()?"🅾️",-3,56,3
?"⬅️",-25,56,3
?"➡️",19,56,3
end function h(d,c,n)local n,o,l=-d,-c,l-n local e=u(n,o,l)n,o,l=n/e,o/e,l/e local n,o=n*a,o*a return n*.75-d*.25,o*.75-c*.25end function d()local n,o,l=rnd(a-1),rnd(),rnd()local n,o,l=n*sin(o)*cos(l),n*sin(o)*sin(l),n*cos(o)return{x=n,y=o,z=l,x0=n,y0=o,width=1,height=1,dy=0}end function u(n,o,l)local e=atan2(n,o)local n=n*cos(e)+o*sin(e)local o=atan2(n,l)return n*cos(o)+l*sin(o)end

Leave a comment

Log in with itch.io to leave a comment.

Comments

No one has posted a comment yet