Play game
Snake in 467 bytes's itch.io pageHow many characters of code did you use?
472
Include your code here, if you'd like to show it off!
r=rnd
xd=0l=3p=0q=128x=32y=64dx=.3dy=0yd=0t={}a=r(q)\8*8s=r(q)\8*8c=rectfill::_::for i=0,999do
pset(r(q),r(q),1)end
b=btnp()if(b>0and b<4)dx=(b*2-3)/l dy=0
if(b>3)dy=(b/2-3)/l dx=0
xd=x\8*8x+=dx
l-=.0001yd=y\8*8y+=dy
if(x>q or x<0or y>q or y<0)goto z
add(t,{xd,yd,99})for i in all(t) do
c(i[1],i[2],i[1]+7,i[2]+7,3)c(xd,yd,xd+7,yd+7)c(a,s,a+7,s+7,8)i[3]-=1if(i[3]<1)del(t,i)end
if(a==xd and s==yd)a=r(q)\8*8s=r(q)\8*8p+=1
?p,1,1,7
goto _::z::?'game over '..p,44,32,7
Leave a comment
Log in with itch.io to leave a comment.
Comments
No one has posted a comment yet