Play game
Speed Pool #Pico1K's itch.io pageCharacters/Bytes used
1,024 bytes (1,022 chars)
Source Code
c=circfill
s=stat
poke(24365,1)pal(4,0,1)l={}h=0y=0v=5for i=1,16do
q=25+h*6w=y+48e=i==11and 6or(i%2)*3
if(i>15)q=99w=64e=9
b=add(l,{x=q,y=w,c=e,a=0,s=0,v=0,b=0})y+=7v-=1if(v<1)h+=1v=5-h y=h*4end
_set_fps(60)while(#l>1)do
m={}u=s(32)i=s(33)cls()?"\^pspeed pool \fd"..t()
rectfill(0,25,127,102,3)for i=0,5do
x=i*63c(x,26,5,0)c(x,101,5)end
for k,b in pairs(l)do
x=b.x
y=b.y
b.v*=.97b.b*=.97x+=b.v
y+=b.b
if(pget(x,y)<1)del(l,b)?"\ax3c1"
for l,t in pairs(l)do
a=x-t.x
z=y-t.y
d=sqrt(a*a+z*z)
if(k!=l and d<6)add(m,{b,t})o=(d-8)/2x-=o*(a/d)y-=o*(z/d)t.x+=o*(a/d)t.y+=o*(z/d)?"\as0c"
end
if(x>124or x<4)b.v*=-1.1
if(y>q or y<29)b.b*=-1.1
for i=1,3do
c(x+min(2-i),y+1-i,4-i,({2,8,14,9,10,7,4,4,5,6,7,7})[b.c+i])end
b.x=x b.y=y end
for p in all(m)do
a=p[1]z=p[2]d=sqrt((a.x-z.x)*(a.x-z.x)+(a.y-z.y)*(a.y-z.y))n=(z.x-a.x)/d
r=(z.y-a.y)/d
v=a.v*-r+a.b*n
y=z.v*-r+z.b*n
o=a.v*n+a.b*r
k=z.v*n+z.b*r
a.v=-r*v+n*k
a.b=n*v+r*k
z.v=-r*y+n*o
z.b=n*y+r*o
end
if(s(34)>0)b.v=-(b.x-u)/4b.b=-(b.y-i)/4
fillp(░)line(b.x,b.y,u,i)fillp()flip()end
Link to Commented Source Code
https://rentry.co/speed-pool-1k
Leave a comment
Log in with itch.io to leave a comment.
Comments
Nice gfx, nice game! This game really takes 1K of code to the limit of what's possible.
Thank you - very kind of you to say! 😊
Very cool! That's a lot of functionality to cram into so little space.
Thank you! 😊
Wow, this is amazing. Momentum, use of mouse with adjustable strength, direction indicator. And its actually fun to play :) .
Just awesome.
Thank you for the kind words. 🙏
I'm glad you found it fun & good to play - makes it all worth it ☺️