Just a straightforward snake clone small enough to fit in two tweets. Use the arrow keys to move! Press ctrl-r to reset after game over.

How many characters of code did you use?
519

Include your code here, if you'd like to show it off!

x=4a={}s=4d=1l=3w=30y=x
r=rectfill
b=btn
function p()return flr(rnd(w))end
function k(i,j,c)r(i*s+1,j*s+1,i*s+s,j*s+s,c)end
q=p()e=p()t=0o=false
::_::
t+=1
for i=0,3do
if(b(i))d=i
end
if t%3==0and not o then
cls()add(a,{x,y})
if(#a>l)del(a,a[1])
if(x==q and y==e)l+=1q=p()e=p()
if(d==0)x-=1
if(d==1)x+=1
if(d==2)y-=1
if(d==3)y+=1
if(x<0)x=w
if(x>w)x=0
if(y<0)y=w
if(y>w)y=0
?""..l,0,0,7
for z in all(a)do
o=o or z[1]==x and z[2]==y
k(z[1],z[2],3)
end
k(q,e,8)k(x,y,11)end
if o then
?"game over",47,62,7
end
flip()goto _

StatusReleased
PlatformsHTML5
Rating
Rated 5.0 out of 5 stars
(1 total ratings)
Authorandrewedstrom
Made withPICO-8
TagsCasual, PICO-8, Retro, Singleplayer, tweetcart

Comments

Log in with itch.io to leave a comment.

Snake is a classic!