WarpFlight
i have been obsessed with 20-liners lately.
Warpflight is a combination asteroid shooter and racer.
The asteroids speed towards you, and you have to either
shoot them or get out of the way. pick up green power-ups
to recharge your energy. your ship is under constant
acceleration; it never slows down until the end of the level.
this game does require some extra media, provided at the red DOWNLOAD link on this window.
also, you can download the entire thing (EXE, media, code, readme) at this link (only 2mb):
http://warpflight.astrumgames.com/downloads/WF-20LC.zip
set display mode 800,600,32 : sync on : sync rate 20 : sync : randomize timer() : backdrop on : color backdrop 0 : autocam off : hide mouse : set text size 22 : set text to bold : set image colorkey 0,0,0
load mesh "yorship2.x",1 : load mesh "ast2.x",2 : load mesh "misl1.x",5 : load mesh "pwrup2.x",6 : load image "bg7.jpg",2 : load image "ast.jpg",3 : load image "shiptex5.jpg",4 : load image "smoke2.jpg",5 : load image "explo.jpg",6 : load image "pwrup.jpg",7 : load sound "smalaser.wav",1 : load sound "get.wav",2 :load sound "shortexplo.wav",3 : load sound "yorhit2.wav",4 : make object sphere 999,2000 : set object cull 999,0 : texture object 999,2 : yrotate object 999,270 : set object collision off 999 : position camera 0,0,-30 : sync
new_game_here: : for t=1 to 321 : if object exist(t) : delete object t : endif : next t : SCORE =0 : TD#=0.0 : life=300 : sector=0 : dist#=0.0 : bonus=0 : if light exist(1) : delete light 1 : endif : firewait=0 : restore
ink rgb(251,61,35),0 : center text 400,100,"WARPFLIGHT" :center text 400,140,"Pilot your spaceship at ever increasing velocity" :center text 400,170,"using the arrowkeys to avoid space debris. " :center text 400,200,"Fire energy missiles at debris using the [SHIFT] key." :center text 400,230,"Collect green power-ups to restore your energy." :center text 400,400,"Press Any Key To Play" :center text 400,430,"or [ESC] to Exit" :center text 400,560,"AstrumGames.com":sync :wait key
center text 400,100,"WARPFLIGHT" :center text 400,140,"Shooting Debris scores 50 points." :center text 400,170,"Collecting a Power-up gives 100 energy." :center text 400,200,"Colliding with Debris takes 100 energy." :center text 400,230,"Firing Energy Missiles Costs 10 energy." :center text 400,260,"There is a Bonus at the end of each sector of 200 energy" :center text 400,290,"And Points Based on Distance Traveled Minus Collisions." :center text 400,400,"Press Any Key To Play" : center text 400,560,"AstrumGames.com" : sync :wait key
make object 1,1,4 : scale object 1,50,30,60 : position object 1,0,-10,0 : point object 1,0,0,100 : make light 1 : set point light 1,0,0,0 : color light 1,rgb(255,255,255) : set light range 1,1500 : hide light 0 : for t=100 to 199 : make object box t,0.35,0.35,10+rnd(10) : position object t,rnd(400)-200,rnd(300)-150,rnd(1250)+100 : set object collision off t : color object t,rgb(0,0,155) :next t
for t=200 to 299 : make object t,2,3 : position object t,rnd(48)-24,rnd(36)-18,rnd(1500)+100 : rotate object t,rnd(360),rnd(360),rnd(360) : fix object pivot t :next t : dim b(100) : for t=90 to 99 : make object t,5,4 : scale object t,50,50,50 : set object light t,0 : b(t)=0 : next t
for t=20 to 50 : make object cube t,0.250 : set object collision off t : hide object t :next t : for t=75 to 80 : make object t,6,7 :set object light t,0: scale object t,125,125,125 : position object t,rnd(48)-24,rnd(36)-18,rnd(1500)+100 :next t : for t=300 to 320 : make object plain t,10,2 : texture object t,5 : set object cull t,0 : set object collision off t : set object transparency t,1 : ghost object on t : fade object t,200 : position object t,0,0,-3000 : f=299 : next t
new_level: : if bonus>0 : center text 400,100,"BONUS:" : center text 400,140,str$(bonus) : sync : wait 1500 :score=score+bonus : endif : for t=90 to 99 : position object t,0,0,3000 : b(t)=0 : next t : inc sector : spd#=1.5+sector : life=life+200: position camera 0,0,-30 : read numast,spdinc#,travel_goal : bonus=travel_goal*10 : do : spd#=spd#+spdinc# :dist#=dist#+spd#/100.0 : td#=td#+spd#/100.0
if dist#>travel_goal :dist#=0.0 :for t=1 to 40 : move camera -7.5 : center text 400,100,"SECTOR CLEAR" : sync :next t :c=1 :for t=75 to 299 : if object exist(t) : a=t : b=1 : gosub position_something : endif :next t : for a=1 to 40 :for t=100 to 199 : move object t,-20.0 :next t : move camera 7.5 :center text 400,100,"ENTERING SECTOR "+STR$(sector+1) : sync : next a :goto new_level :endif
if upkey() : if object position y(1)<15.0 : move object up 1,0.75 : endif : endif :if downkey() : if object position y(1)>-15.0 : move object down 1,0.75 : endif : endif : if rightkey() : if object position x(1)<17.0 : move object right 1,0.75 : endif : endif : if leftkey() : if object position x(1)>-17.0 : move object left 1,0.75 : endif : endif
dec firewait :if shiftkey() : if firewait<1 : a=0 : for t=90 to 99 : if b(t)<1 : a=t : exit : endif : next t : if a>0 : play sound 1,0 : life=life-10 : position object a,object position x(1),object position y(1),5 : point object a,0,0,2000 : b(t)=175 : firewait=(17-sector) : endif : endif :endif
for t=90 to 99 : move object t,3.5 : dec b(t) :if b(t)>0 : x=object collision (t,0) : if x>199 : if x<300 : a=x : gosub explode : score=score+50 : a=x : b=1 : c=0 : gosub position_something : b(t)=-1 : position object t,0,0,2500 : endif : endif :endif : next t
for t=100 to 199 : move object t,-spd# : if object position z(t)<-20.0 : a=t : b=10 : c=0 : gosub position_something : endif :next t : for t=200 to 299 : move object t,-spd#/2.0 : if object position z(t)<-200.0 : if numast>0 : dec numast : a=t : b=1 : c=0 : gosub position_something : endif : endif :next t
c=0 : for t=75 to 80 : move object t,-spd#/1.75 : if object position z(t)<-200.0 : if numast>0 : a=t : b=1 : gosub position_something : endif : endif :next t : x=object collision (1,0) : if x>199 : if x<300 : play sound 4,0 : life=life-100 : bonus=bonus-100 : dec numast : a=x : gosub explode : b=1 : gosub position_something : endif : endif
for t=75 to 80 : zrotate object t,object angle z(t)+3.5*sector : next t : if life<0 : center text 400,100,"GAME OVER" : center text 400,140,"Final Score: "+STR$(score) : center text 400,170,"Light Years Traveled: "+STR$(int(td#)) : sync : wait 6000 : goto new_game_here : endif : inc f :if f=321 : f=300 :endif :position object f,object position x(1),object position y(1),0 :for t=300 to 320 : move object t,1.5 :next t
if x>74 : if x<81 : play sound 2,0 : life=life+100 : a=x : b=1 : c=0 : gosub position_something : endif :endif : for t=20 to 50 : move object t,1 : next t : center text 400,10,str$(travel_goal-int(dist#))+" Light Years Remaining" : if life>1000 : life=1000 : endif :center text 400,560,"Energy: "+str$(life) : text 10,560,"Sector: "+str$(sector) :text 660,560,"Score: "+str$(score) : sync : loop
explode: : play sound 3,0 : xx=object position x(a) : yy=object position y(a) : zz=object position z(a) : for q=20 to 50 : position object q,xx,yy,zz : rotate object q,rnd(360),rnd(360),rnd(360) : texture object q,rnd(3)+3 : show object q: next q : return
position_something: : if a>99 : if a<200 : b=10 : endif : endif : position object a,rnd(52*b)-26*b,rnd(39*b)-19.5*b,1500+rnd(1250) +( (c=1)*((-rnd(700)-600) ) ): rotate object a,0,0,0 : return
data 50,0.0100,75,100,0.0125,100,250,0.0150,150,400,0.0175,220,750,0.0150,375,1000,0.0150,500,50,0.0200,75,100,0.0250,90,250,0.0300,175,400,0.0350,250,750,0.0400,400,1000,0.030,600,99999,0.010,99999
` this game adheres to the rules of TGC's "20 Line Challenge"
` specifically, no more than 25 commands may be put on any line,
` and a total of 20 lines is the maximum.
` also, no more than 200KB UNcompressed media is allowed.
` (game media totals 163kb uncompressed)
` by Bob Saunders
` visit ASTRUMGAMES.COM
let me know what you think.
bob