

About This Game
Speed Pool 1K ð±
This is my only entry (so far) to
#Pico1k
Jam.
It's a game of Speed Pool (with Timer), in just 1,024 bytes (1,022 chars)
, using NO predefined art/sfx assets!
ð
The plan was originally to try to do a demake of Arcade Pool, but quickly realised that was far too ambitious!
OBJECTIVE
Pot all the balls
(but
not
the white)
as fast as you can!
CONTROLS
Aim
= Mouse Move
Shoot
= Mouse Click
Tip: Farther you aim= harder the shot (but too hard & you'll fly off the table!)
Restart Game
= Browser Refresh (or Press ENTER > Reset Cart)
(Sorry, ran out of code to make nice restart logic ð)
FEATURES
ð±
Realistic* 2D Physics
ï¸ðï¸ 60 FPS
ð
SFX
â± "
Against the Clock" action
(What's your best clearance time? ð)
ACKNOWLEDGEMENTS
Many thanks to
PC101
for their
Elastic 2D ball physics
demo code
SOURCE CODE 1,024 bytes / 1,022 chars
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