home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / PadHop.dxr / Internal_1_turtle.ls < prev    next >
Encoding:
Text File  |  2002-01-31  |  1.9 KB  |  67 lines

  1. property pSprite, spriteNum, pSpeed, plast, inty, ass, rolla, unda, freak
  2. global gFloats, gCurrentFloat
  3.  
  4. on beginSprite me
  5.   pSprite = sprite(spriteNum)
  6.   pSprite.bgColor = rgb(177, 232, 240)
  7.   pSprite.ink = 36
  8.   pSpeed = 0
  9.   inty = 0
  10.   ass = 200.random + 100
  11.   plast = the ticks
  12.   timeout("turtle" && spriteNum).new(25, #moveturtle, me)
  13. end
  14.  
  15. on moveturtle me
  16.   pSprite.locH = pSprite.locH + pSpeed
  17.   if pSprite.flipH then
  18.     theBoundary = 580
  19.     if (pSprite.locH + (pSprite.width / 2)) >= theBoundary then
  20.       pSprite.flipH = not pSprite.flipH
  21.       pSpeed = -pSpeed
  22.     end if
  23.   else
  24.     if not pSprite.flipH then
  25.       theBoundary = 0
  26.       if (pSprite.locH - (pSprite.width / 2)) <= theBoundary then
  27.         pSprite.flipH = not pSprite.flipH
  28.         pSpeed = -pSpeed
  29.       end if
  30.     end if
  31.   end if
  32. end
  33.  
  34. on exitFrame me
  35.   if pSprite <> gCurrentFloat then
  36.     if rolla then
  37.       if not isFrogOn2(pSprite) then
  38.         if the ticks > (plast + freak) then
  39.           if not inty then
  40.             pSprite.member = member("diveturtle")
  41.             inty = 1
  42.           else
  43.             if (the ticks > (plast + freak + 10)) and (the ticks < (plast + freak + ass)) then
  44.               pSprite.member = member("underturtle")
  45.               unda = 1
  46.               pSprite.bgColor = rgb(255, 255, 255)
  47.             else
  48.               if the ticks > (plast + freak + ass) then
  49.                 unda = 0
  50.                 if the ticks < (plast + freak + ass + 10) then
  51.                   pSprite.bgColor = rgb(177, 232, 240)
  52.                   pSprite.member = member("diveturtle")
  53.                 else
  54.                   pSprite.member = member(5, "the graffic")
  55.                   pSprite.bgColor = rgb(177, 232, 240)
  56.                   plast = the ticks
  57.                   inty = 0
  58.                 end if
  59.               end if
  60.             end if
  61.           end if
  62.         end if
  63.       end if
  64.     end if
  65.   end if
  66. end
  67.