Play game
Circlshoot's itch.io pageCompressed Bytes used
966
Source Code (OPTIONAL)
ss=1
hs=0
function f()
pa.z=5
t+=10
t2+=10
t3=10
b1=1
end
function g()
local x=flr(rnd(110))+10
local y=flr(rnd(110))+10
local j={}
j.a=5
j.c=1
j.h=1
j.x=x
j.y=y
j.t=0
add(jj,j,1)
end
function s()
local x=0
if ta==20-flr(rnd(7))+1 then
while x<flr(rnd(5))+1+flr(jc/10)do
g()
x+=1
end
ta=0
end
end
function _init()
cls(-15)
pa={}
pa.x=64
pa.y=64
pa.z=1
jc=0
b1=0
g1=true
z=0q=0
t=0t2=0t3=0c0=3h=2
i=1
tv=0 ta=0
jj={}
je={}
fir=1
end
function _update()
if ss==1then
if(btn(5))ss=0
elseif g1 then
if tv<=30then
tv+=1
else tv=0end
if(tv==30)ta+=1
if fir==1then
g()
fir=0
end
s()
if(h==2)c0=-5
if(h==1)c0=-7
if(h==0)c0=8
if(t>0)t-=1
ac=0.1
if(btn(0))z-=ac
if(btn(1))z+=ac
if(btn(2))q-=ac
if(btn(3))q+=ac
if btn(4)and pa.z==1then f()end
if(pa.x>=128)pa.x=128z-=z+1
if(pa.x<=0)pa.x=0z-=z-1
if(pa.y<=0)pa.y=0q-=q-1
if(pa.y>=128)pa.y=128q-=q+1
pa.x+=z
pa.y+=q
if(pa.z>1)then
if(t3==0)pa.z-=1 t3=30
end
z*=0.97
q*=0.97
t3-=1
ub()
b1=0
else
if(jc>hs) hs=jc
if(btn(5))_init()
end
end
function uc()
for j in all(jj)do
if(tv==30)j.t+=1
if j.t==5then
j.t=0
if(j.c==4)j.a=10
if(j.c==8)j.a=2
if(j.c<10)j.c+=1
if j.c>=10then
if(g1)w()
add(je,j)
del(jj,j)
mh()
end
end
pg(j)
end
for j in all(je)do
j.a=6
j.c+=1
if(j.c>200)del(je,j)
pb(j)
end
end
function ub()
for j in all(jj)do
if b1==1and btn(4)then
if cc(j,pa)then
j.h-=1
end
end
if(j.h<=0)then
jc+=1
add(je,j)
del(jj,j)
end
end
end
function cc(a,b)
local z,q=abs(b.x-a.x),abs(b.y-a.y)
if(z<q)z,q=q,z
local dst=z/sin(atan2(q,z))
return dst<a.c+5
end
function w()
cls(7)
end
function pb(t)
circ(t.x,t.y,t.c,t.a)
end
function pg(t)
circfill(t.x,t.y,t.c,t.a)
end
function mh()
h-=1
if(h<0)g1=false
end
function _draw()
cls(-15)
uc()
if ss==1then
print("circlshoot", 10, 20)
print("shoot as many circls as \nyou can!",10,60,11)
print("press ❎ to start!",10,90,11)
elseif g1 then
circfill(pa.x,pa.y,pa.z,c0)
circ(pa.x,pa.y,5,c0)
print(jc,5,5,c0)
else
print("high score: "..hs,10,40,11)
print("circls shot down: "..jc,10,70,11)
print("press ❎ to restart",10,60,11)
end
end





Leave a comment
Log in with itch.io to leave a comment.