Arrow keys to move

BTW if die as soon as you run the game refresh the page. IDK how to fix it

This is my first Tweetcart and it's just 472 bytes :D

Code:

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


Comments

Log in with itch.io to leave a comment.

Great work! Snake games are always fun to play. 🐍

(1 edit)

Thanks :)

Nice work, I like the fading effect on the snake. Is there a way to restart the game without restarting the cart?

No sadly, I couldn't add it without adding a bunch more lines

my top score is 23 ;-;

(2 edits)

now its 82