home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 127 / dpcs0998.iso / Internet / netobs / Install.exe / t2.z / BREAKOUT.DCR / 00015_paddleKeyDown.ls < prev    next >
Encoding:
Text File  |  1998-01-20  |  1.3 KB  |  50 lines

  1. on paddleKeyDown
  2.   global giPongEasyMode, giPlayFieldBottomBoundary, giPongStraightThru, gbPongWaves, glBulletsInPlay, giPongPaddleChannel, giPaddleHalfWidth, gbPaused
  3.   set lsValidKeys to "1,2,3,4,5,6,7,8,9"
  4.   if lsValidKeys contains the key then
  5.     pongPaddleLevel(integer(the key))
  6.   end if
  7.   if the key = "f" then
  8.     set liCount to count(glBulletsInPlay)
  9.     if liCount < 7 then
  10.       set liChan to liCount + 15
  11.       set liH to the locH of sprite giPongPaddleChannel + giPaddleHalfWidth
  12.       set liV to the locV of sprite giPongPaddleChannel - 10
  13.       set liPos to liCount + 1
  14.       addAt(glBulletsInPlay, 1, birth(script "bulletScript", liH, liV, 5, liChan, "Bullet", liPos))
  15.     end if
  16.   end if
  17.   if the key = "e" then
  18.     set giPongEasyMode to 1
  19.     beep(3)
  20.   end if
  21.   if the key = "h" then
  22.     set giPongEasyMode to 0
  23.     beep(2)
  24.   end if
  25.   if the key = "s" then
  26.     pongStraightThruToggle()
  27.   end if
  28.   if the key = "r" then
  29.     pongPaddleChange(random(5))
  30.   end if
  31. end
  32.  
  33. on pongWaveToggle
  34.   global gbPongWaves
  35.   if gbPongWaves then
  36.     set gbPongWaves to 0
  37.   else
  38.     set gbPongWaves to 1
  39.   end if
  40. end
  41.  
  42. on pongStraightThruToggle
  43.   global giPongStraightThru
  44.   if giPongStraightThru then
  45.     set giPongStraightThru to 0
  46.   else
  47.     set giPongStraightThru to 1
  48.   end if
  49. end
  50.