Ball Deflector 500

Get the balls through the gates of the same colour. After successfully passing 20 balls, the game is over.

A tiny TweetTweetJam-9 entry in 500 characters of code.

Sorry, there was no room left for timer and highscore. All 500 characters of code were used.

Controls:
  • Left/Right/Up/Down: move your pad

Code:

x=64y=64s=20p={}f=128m=64c=circfill::_::cls(6)for i=0,1do
c(m,i*f,24,9+i)c(i*f,m,24,11+i)end
rectfill(5,5,122,122,1)?s
b=btn()x+=(b&2)-(b&1)*2y+=(b&8)/4-(b&4)/2c(x,y,5,13)if(#p<2)add(p,{x=32+rnd(m),y=64,u=1,v=1,c=9+rnd(4)\1})
for q in all(p)do
for a=0,7do
u=cos(a/8)v=sin(a/8)b=pget(q.x+4*u,q.y+4*v)w=q.u*u+q.v*v
if(w>0and b>1and b!=q.c)q.u-=u*w*2q.v-=v*w*2
end
if(max(abs(q.x-m),abs(q.y-m))>68)del(p,q)s-=1?"\acd"
end
for q in all(p)do
q.x+=q.u
q.y+=q.v
c(q.x,q.y,3,q.c)end
if(s<1)run()
flip()goto _
StatusReleased
PlatformsHTML5
Rating
Rated 3.0 out of 5 stars
(1 total ratings)
AuthorSkyBerron
GenreAction
Made withPICO-8
TagsPICO-8, tweettweetjam

Leave a comment

Log in with itch.io to leave a comment.