Play game
Ball Deflector 500's itch.io pageHow many characters of code did you use?
500
Include your code here, if you'd like to show it off!
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 _
Leave a comment
Log in with itch.io to leave a comment.
Comments
This was a lot of fun!
Took me a while to realise the knack of getting myself in position *before* the ball collides to guarantee the angle I wanted (rather than chase and try to force the bounce).
Got to 20 and felt like I'd achieved something (either that, or a new CAPTCHA method! 😅)
Nice one 👍
Harder than it looks, but still a chill experience. Kind of glad you didn't fit the timer in.
At first, I thought this game could be more challenging and fun. But I had to reduce the complexity of the code to meet the 500 character limit. As a result, feel and control are considerably worse than anticipated.