home *** CD-ROM | disk | FTP | other *** search
/ Komputer for Alle: Internet utan modem / Internet CD.iso / web / computer / wwweps~1.com / adam / galactic.dcr / 00104_acceleration.ls < prev    next >
Encoding:
Text File  |  1997-03-06  |  5.5 KB  |  239 lines

  1. on move_ship
  2.   global right, up, mup, mright, max_shipspeed, player_acc
  3.   checkmax()
  4.   set mright to mright + right
  5.   set mup to mup + up
  6.   set a to find_whole(mup)
  7.   set the locV of sprite 10 to the locV of sprite 10 - a
  8.   set mup to mup - a
  9.   set a to find_whole(mright)
  10.   set the locH of sprite 10 to the locH of sprite 10 + a
  11.   set mright to mright - a
  12.   if the left of sprite 10 < 0 then
  13.     set right to right + (player_acc * 2)
  14.   else
  15.     if the right of sprite 10 > 450 then
  16.       set right to right - (player_acc * 2)
  17.     else
  18.       if the top of sprite 10 < 0 then
  19.         set up to up - 1 - (player_acc * 2)
  20.       else
  21.         if the bottom of sprite 10 > 400 then
  22.           set up to up + (player_acc * 2)
  23.         end if
  24.       end if
  25.     end if
  26.   end if
  27. end
  28.  
  29. on astroids
  30.   global astroidlist, max_astroids
  31.   repeat with t = 1 to count(astroidlist)
  32.     if not (getAt(astroidlist, t) = 0) then
  33.       animateastroid(getAt(astroidlist, t))
  34.     end if
  35.   end repeat
  36. end
  37.  
  38. on lil_ships
  39.   global lil_list, max_littleships
  40.   repeat with t = 1 to max_littleships
  41.     if not (getAt(lil_list, t) = 0) then
  42.       animatelil_ships(getAt(lil_list, t))
  43.     end if
  44.   end repeat
  45. end
  46.  
  47. on lil_ships_fire
  48.   global lil_bulletlist, max_littlebullets
  49.   repeat with t = 1 to max_littlebullets
  50.     if not (getAt(lil_bulletlist, t) = 0) then
  51.       animatelil_bullet(getAt(lil_bulletlist, t))
  52.     end if
  53.   end repeat
  54. end
  55.  
  56. on fire
  57.   global bulletlist, max_bullets
  58.   repeat with t = 1 to max_bullets
  59.     if not (getAt(bulletlist, t) = 0) then
  60.       animatebullet(getAt(bulletlist, t))
  61.     end if
  62.   end repeat
  63. end
  64.  
  65. on boss_fires
  66.   global boss_bulletlist, boss_bullets
  67.   repeat with t = 1 to boss_bullets
  68.     if not (getAt(boss_bulletlist, t) = 0) then
  69.       anim_bullets(getAt(boss_bulletlist, t))
  70.     end if
  71.   end repeat
  72. end
  73.  
  74. on checkmax
  75.   global right, up, max_shipspeed
  76.   set n to max_shipspeed
  77.   if right > n then
  78.     set right to n
  79.   end if
  80.   if right < -n then
  81.     set right to -n
  82.   end if
  83.   if up > n then
  84.     set up to n
  85.   end if
  86.   if up < -n then
  87.     set up to -n
  88.   end if
  89. end
  90.  
  91. on find_whole n
  92.   if n >= 0 then
  93.     if integer(n) > n then
  94.       return integer(n) - 1
  95.     end if
  96.     if integer(n) <= n then
  97.       return integer(n)
  98.     end if
  99.   end if
  100.   if n < 0 then
  101.     if integer(n) < n then
  102.       return integer(n) + 1
  103.     end if
  104.     if integer(n) >= n then
  105.       return integer(n)
  106.     end if
  107.   end if
  108. end
  109.  
  110. on displays
  111.   global shield, armor, score, max_shield
  112.   put score into field "score"
  113.   if armor <= 0 then
  114.     death()
  115.   end if
  116.   if shield < 0 then
  117.     set armor to armor - abs(shield)
  118.     if armor < 0 then
  119.       set armor to 0
  120.     end if
  121.     set shield to 0
  122.   end if
  123.   set the width of sprite 46 to shield / 2
  124.   set the width of sprite 48 to armor / 2
  125.   updateStage()
  126.   if shield < max_shield then
  127.     set shield to shield + (max_shield / 200) + 1
  128.   end if
  129.   if armor = 0 then
  130.     death()
  131.   end if
  132.   set the ink of sprite 10 to 8
  133. end
  134.  
  135. on death
  136.   startTimer()
  137.   repeat with n = 31 to 40
  138.     set the visible of sprite n to 1
  139.     set the castNum of sprite n to random(4) + 136
  140.     set the locH of sprite n to the locH of sprite 10 + random(100) - 50
  141.     set the locV of sprite n to the locV of sprite 10 + random(100) - 50
  142.   end repeat
  143.   updateStage()
  144.   repeat while the timer < 20
  145.     nothing()
  146.   end repeat
  147.   set the visible of sprite 10 to 0
  148.   repeat with n = 31 to 40
  149.     set the castNum of sprite n to the castNum of sprite n + 1
  150.     if the castNum of sprite n >= 141 then
  151.       set the visible of sprite n to 0
  152.     end if
  153.     puppetSound("explosion")
  154.   end repeat
  155.   updateStage()
  156.   repeat while the timer < 40
  157.     nothing()
  158.   end repeat
  159.   repeat with n = 31 to 40
  160.     set the castNum of sprite n to the castNum of sprite n + 1
  161.     if the castNum of sprite n >= 141 then
  162.       set the visible of sprite n to 0
  163.     end if
  164.     puppetSound("explosion")
  165.   end repeat
  166.   updateStage()
  167.   repeat while the timer < 60
  168.     nothing()
  169.   end repeat
  170.   repeat with n = 31 to 40
  171.     set the castNum of sprite n to the castNum of sprite n + 1
  172.     if the castNum of sprite n >= 141 then
  173.       set the visible of sprite n to 0
  174.     end if
  175.     puppetSound("explosion")
  176.   end repeat
  177.   updateStage()
  178.   repeat while the timer < 80
  179.     nothing()
  180.   end repeat
  181.   death2()
  182. end
  183.  
  184. on death2
  185.   startTimer()
  186.   repeat with n = 31 to 40
  187.     set the castNum of sprite n to random(4) + 136
  188.     set the visible of sprite n to 1
  189.     set the locH of sprite n to the locH of sprite 10 + random(100) - 50
  190.     set the locV of sprite n to the locV of sprite 10 + random(100) - 50
  191.   end repeat
  192.   updateStage()
  193.   repeat while the timer < 20
  194.     nothing()
  195.   end repeat
  196.   updateStage()
  197.   set the visible of sprite 10 to 0
  198.   repeat with n = 31 to 40
  199.     set the castNum of sprite n to the castNum of sprite n + 1
  200.     if the castNum of sprite n >= 141 then
  201.       set the visible of sprite n to 0
  202.     end if
  203.     puppetSound("explosion")
  204.   end repeat
  205.   updateStage()
  206.   repeat while the timer < 40
  207.     nothing()
  208.   end repeat
  209.   repeat with n = 31 to 40
  210.     set the castNum of sprite n to the castNum of sprite n + 1
  211.     if the castNum of sprite n >= 141 then
  212.       set the visible of sprite n to 0
  213.     end if
  214.     puppetSound("explosion")
  215.   end repeat
  216.   updateStage()
  217.   repeat while the timer < 60
  218.     nothing()
  219.   end repeat
  220.   repeat with n = 31 to 40
  221.     set the castNum of sprite n to the castNum of sprite n + 1
  222.     if the castNum of sprite n >= 141 then
  223.       set the visible of sprite n to 0
  224.     end if
  225.     puppetSound("explosion")
  226.   end repeat
  227.   updateStage()
  228.   repeat while the timer < 80
  229.     nothing()
  230.   end repeat
  231.   go(500)
  232. end
  233.  
  234. on play_the_final
  235.   global level
  236.   set level to "10-Completed"
  237.   go(400)
  238. end
  239.