Planetary Defense
Planetary Defense is an arcade style game about defending the planed tom falling stars. The game was written in less that 500 characters for TweetTweetJam 9 and was developed using the PICO-8 fantasy console.
Controls
Press the X key to fire at the incoming stars.
Restart the game with Ctrl+R
Rules
You must defend the planet from the dangerous falling stars. To do this, fire using the planetary defense canon.
Keep in mind that the cannon motion is controlled by a pendulum so you will not be able to aim. Check your timing and fire away!
About
The game was supposed to be called "Attack of the Alphanauts" and would have seen you defend the planet from letter-shaped space ships. However to keep the game within the 500 characters, I had to remove the character randomization mechanic and opted for falling stars.
The Code
The final character count came to 492. The code can be found below.
x=40y=40e={}b={}ed=0v=0s=0♥=3g=64f=128o=circfill d=del
::_::
h=t()/3m=sin(h)x=g+m*20y=115+-cos(h*2)*10ed-=1v-=1if(ed<1)ed=90add(e,{x=rnd(60)+30,y=-5})
cls(15)o(x,y,2,1)o(g,f,8)line(g,f,x,y)if(btn(❎)and v<1)v=15add(b,{k=x-g,u=y-f,x=x,y=y})
for j in all(b)do
j.x+=j.k*.02j.y+=j.u*.02for l in all(e)do if(abs(l.x-j.x)+abs(l.y-j.y)<5)d(e,l)d(b,j)s+=10end
o(j.x,j.y,1,3)end
for l in all(e)do l.x+=m*.2l.y+=.5?"★",l.x-3,l.y-2,2
if(l.y>f)s-=5♥-=1d(e,l)end
?"♥"..♥.." s:"..s,5,3,1
flip()if(♥>0)goto _
Leave a comment
Log in with itch.io to leave a comment.