home *** CD-ROM | disk | FTP | other *** search
/ GQ - Louise, World Cup, …remy Clarkson, Armageddon / GQCD.iso / files / game.dxr / 00010_explosionScript.ls < prev    next >
Encoding:
Text File  |  1998-05-21  |  1.2 KB  |  44 lines

  1. property ancestor, myName, myNumFrames, myCounter, myDistance, myAngle, myVelocity, endOfGameFlag
  2.  
  3. on new me, type, numFrames, newDistance, newAngle, newVelocity, endFlag
  4.   set ancestor to new(script "spriteGenerator")
  5.   set myCounter to 0
  6.   set myName to the memberNum of member type
  7.   set myNumFrames to numFrames - 1
  8.   set myDistance to newDistance
  9.   set myAngle to newAngle
  10.   set myVelocity to newVelocity
  11.   set endOfGameFlag to endFlag
  12.   append(the actorList, me)
  13.   return me
  14. end
  15.  
  16. on stepFrame me
  17.   animate(me)
  18.   move(me)
  19. end
  20.  
  21. on animate me
  22.   set myCounter to myCounter + 1
  23.   if myCounter > myNumFrames then
  24.     if endOfGameFlag then
  25.       go("win")
  26.     end if
  27.     destroy(me)
  28.   else
  29.     set the memberNum of sprite the spriteNum of me to myName + myCounter
  30.   end if
  31. end
  32.  
  33. on move me
  34.   set myVelocity to myVelocity / 1.10000000000000009
  35.   set myDistance to myDistance - myVelocity
  36.   set the loc of sprite the spriteNum of me to getLoc(myAngle, myDistance)
  37. end
  38.  
  39. on smallExplode me, member, myDeficit
  40.   set startposition to the loc of sprite the spriteNum of me
  41.   set explosion to new(script "explosionScript", member, 20, myDistance, myAngle + myDeficit, myVelocity, 0)
  42.   appear(explosion, startposition, member, 255, 0, 30)
  43. end
  44.