home *** CD-ROM | disk | FTP | other *** search
/ Champak 48 / cdrom_image.iso / Games / rockysbreakout / game.dcr / _gamecode_29_setupDogWalk.ls < prev    next >
Encoding:
Text File  |  2007-09-27  |  1008 b   |  35 lines

  1. property pWorld, pAnimWorld
  2.  
  3. on beginSprite me
  4.   pWorld = member("dog")
  5.   pWorld.resetWorld()
  6.   pAnimWorld = member("dog_walk_anim")
  7.   pAnimWorld.resetWorld()
  8. end
  9.  
  10. on exitFrame me
  11.   if (pWorld.state = 4) and (pAnimWorld.state = 4) then
  12.     paramList = [#world: "dog_walk_anim", #model: "dog", #OrigMotion: "dog", #newMotion: "dog_walk"]
  13.     if paramList = VOID then
  14.       return 
  15.     end if
  16.     tsrcworld = member(paramList.world)
  17.     if pWorld.motion(paramList.newMotion) = VOID then
  18.       tm = pWorld.cloneMotionFromCastmember(paramList.newMotion, paramList.OrigMotion, tsrcworld)
  19.     else
  20.       put "motion already found"
  21.     end if
  22.     tModel = pWorld.model(paramList.model)
  23.     if tModel.removeModifier(#bonesPlayer) then
  24.       tModel.addModifier(#bonesPlayer)
  25.     else
  26.       tModel.bonesPlayer.removeLast()
  27.     end if
  28.     tModel.bonesPlayer.play(paramList.newMotion, 1)
  29.     pWorld.model("dog").rotate(0, 0, 180)
  30.     pWorld.model("dog").translate(-5, 0, 0, #world)
  31.   else
  32.     go(the frame)
  33.   end if
  34. end
  35.