Great game! Although unlimited ammo with no overheating issues makes it easier to survive as long as you don't lose fire power, watching the resulting fireworks is very satisfying. The circfill screen clearing effect is great and the sfx sound is excellent.
Play game
1Kommand's itch.io pageCompressed Bytes used
1024
Source Code (OPTIONAL)
mis,bom,bas={},{},{}
tax,tay,kb,sco,shk=64,64,1,0,0
for n=0,3 do
add(bas,{x=16+n*32,y=120+rnd(5)})
end
function _update()
shk=max(0,shk-.25)
for m in all(mis)do
m.x,m.y,_b=clp(m.x+cos(m.a)*m.s,m.y+sin(m.a)*m.s)
m.d-=m.s
if(m.d<0)_b=1
for b in all(bom)do
if not m.b and dist(b.x-m.x,b.y-m.y)<b.r then
_b=1
sco+=#bas
end
end
if _b then
if(m.b)m.b.w=nil
del(mis,m)
if(m.y>16)boom(m.x,m.y,m.c)
end
end
for b in all(bom)do
b.r+=.4
if(b.r>b.s)del(bom,b)
for a in all(bas)do
if b.y>a.y and dist(b.x-a.x,b.y-a.y)<b.r then
boom(a.x,a.y,8)
del(bas,a)
shk=5
end
end
end
if(#bas==0)return
if btnp(4,1) then
kb=not kb
poke(0x5f2d,kb and 0x0 or 0x3)
end
if btnp(5)then
for n=1,6do
b=rnd(bas)
if not b.w then
print"\as9x6i0g2eb"
fire(b.x,128,b)
b.w=1
break
end
end
end
wave=ceil(20*time()/300)
if(#mis<wave)fire()
end
function _draw()
if shk>0then
cls(1)
print"\as8i6x3c4s3c0"
if(#bas==0)boom(rnd(128),128,8+rnd(3))
end
camera(rnd(shk),rnd(shk))
for i=1,64do
circfill(rnd(128),rnd(128),4,1)
end
line(0,127,128,127,4)
for b in all(bas)do
rectfill(b.x-3,b.y,b.x+3,128,6)
end
for m in all(mis)do
pset(m.x,m.y,m.c)
end
for m in all(bom)do
circfill(m.x,m.y,m.r,m.c)
end
rectfill(0,0,128,6,4)
print("score:"..sco.." wave:"..wave,1,1,6)
if(#bas==0)then
print("earth lost",44,64,8)
return
end
circ(tax,tay,1,1)
if kb then
if(btn(0))tax-=4
if(btn(1))tax+=4
if(btn(2))tay-=4
if(btn(3))tay+=4
else
tax,tay=stat(32),stat(33)
end
circ(tax,tay,1,7)
end
function fire(x,y,b)
d=x and dist(tax-x,tay-y) or 0x100
a=x and atan2(tax-x,tay-y)
x,y=x or rnd(126),y or 1
a=a or atan2(rnd(120)-x,128-y)
add(mis,{x=x,y=y,a=a,s=b and 2or.5,d=d,c=b and 10 or 8+rnd(8),b=b})
end
function boom(x,y,c)
print"\as8i6x3c4s3c0"
add(bom,{x=x,y=y,r=1,s=8+rnd(15),c=c})
end
function clp(a,b)
a=min(128,max(0,a))
b=min(128,max(0,b))
return a,b,a==0 or a==128 or b==0 or b==128
end
function dist(a,b)
return sqrt((abs(a)^2)+(abs(b)^2))
end
Link to Commented Source Code (OPTIONAL)
https://gist.github.com/wesleywerner/0b2d5f1b28c7388866d41a990577ea84
Leave a comment
Log in with itch.io to leave a comment.