Jump to content

Archived

This topic is now archived and is closed to further replies.

chain

Classic scrolling shooter

Recommended Posts

  • Administrators
this is a simple little scrolling shooter game

use the arrow keys to move and the space bar to shoot

 

>;;Airplane Game -- Written by Foshizzlealias  airplanegame {  window -pkodCfB +nt @Airplane -1 -1 300 300  hfree -w Airplane   %bullets = 0   %depth = -50  unset %keys %d  hmake Airplane 100  hadd -m Airplane me.x 150   hadd -m Airplane me.y 260   hadd -m Airplane me.hp 100  hadd -m Airplane level 0  game.loop}alias -l game.loop {   if ($window(@Airplane)) {    var %ticks $ticks    clear -n @Airplane    if ($istok(%keys,37,32)) && ($hget(Airplane,me.x) > 10) {      hdec Airplane me.x $iif($hget(Airplane,Level) == 1, 3, $calc(3 + $v1))      }    if ($istok(%keys,38,32)) && ($hget(Airplane,me.y) > 10) {       hdec Airplane me.y $iif($hget(Airplane,Level) == 1, 3, $calc(3 + $v1))    }    if ($istok(%keys,39,32)) && ($hget(Airplane,me.x)  0) && ($hget(Airplane,Level) != 0) {      var %x 1       while (%x  300) %depth = -50    }    ;Level1    elseif ($hget(Airplane,Level) == 1) {      var %i 20       while (%i >= 0) {        if ($hget(Airplane,enemy1. [ $+ [ %i ] ])) {          tokenize 32 $hget(Airplane,enemy1. [ $+ [ %i ] ])           drawdot -rn @Airplane 255 7 $1 $2           hadd Airplane enemy1. [ $+ [ %i ] ] $1 $iif($2 > 300, - $+ $r(100,275), $calc($2 + 4))         }         dec %i       }      if (%bullets > 0) {        var %e = 1,%b = %bullets        while (%e = 0) {         if ($hget(Airplane,enemy2. [ $+ [ %i ] ])) {          tokenize 32 $hget(Airplane,enemy2. [ $+ [ %i ] ])           drawdot -rn @Airplane 22322 7 $1 $2           hadd Airplane enemy2. [ $+ [ %i ] ] $1 $iif($2 > 300, - $+ $r(100,275), $calc($2 + 10))         }         dec %i       }      if (%bullets > 0) {        var %e = 1,%b = %bullets        while (%e = 0) {         if ($hget(Airplane,enemy3. [ $+ [ %i ] ])) {          tokenize 32 $hget(Airplane,enemy3. [ $+ [ %i ] ])           drawdot -rn @Airplane 8381925 7 $1 $2           hadd Airplane enemy3. [ $+ [ %i ] ] $1 $iif($2 > 300, - $+ $r(100,275), $calc($2 + 8))         }         dec %i       }      if (%bullets > 0) {        var %e = 1,%b = %bullets        while (%e = 1) {         hadd -m Airplane enemy2. [ $+ [ %u ] ] $r(5,275) - $+ $r(100,275)         dec %u      }      hadd -m Airplane me.x 150       hadd -m Airplane me.y 260       hadd -m Airplane level 2    }    elseif ($hfind(Airplane,enemy2.*,0,w) == 0) && ($hget(Airplane,Level) == 2) {       var %u 30      while (%u >= 1) {         hadd -m Airplane enemy3. [ $+ [ %u ] ] $r(5,275) - $+ $r(100,575)        dec %u      }      hadd -m Airplane me.x 150       hadd -m Airplane me.y 260       hadd -m Airplane level 3    }    elseif ($hfind(Airplane,enemy3.*,0,w) == 0) && ($hget(Airplane,Level) == 3) {       window -u @Airplane       noop $input(You Won!,wod,Won!)      window -c @Airplane       Airplanegame    }    if ($hget(Airplane,me.hp) = 1) {           hadd Airplane enemy1. [ $+ [ %i ] ] $r(5,275) - $+ $r(100,275)           dec %i           hadd Airplane level 1        }      }       elseif ($inrect($mouse.x,$mouse.y,100,200,100,30)) {        noop $input(Airplane $crlf $+ Created by Foshizzle,qod,Credits)      }      elseif ($inrect($mouse.x,$mouse.y,100,250,100,30)) {        hfree Airplane        unset %depth        window -c @Airplane      }    }  }}

Link to comment
Share on other sites



×
×
  • Create New...