Katchau01

EoC_anim.lua

Aug 17th, 2020 (edited)
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. --For usage, check out the encounter Lua's EncounterStarting() and Update() functions.
  2.  
  3. -- First, we can create the torso, legs and head.
  4. eyeofcthulhu = CreateSprite("Eye_of_Cthulhu")
  5.  
  6. --Now we adjust the height for the individual parts so they look more like a skeleton and less like a pile of bones.
  7. eyeofcthulhu.y = 350
  8.  
  9. --Finally, we do some frame-by-frame animation just to show off the feature. You put in a list of sprites,
  10. --and the time you want a sprite change to take. In this case, it's 1/2 of a second.
  11. eyeofcthulhu.SetAnimation({"Eye_of_Cthulhu", "Eye_of_Cthulhu2", "Eye_of_Cthulhu3"}, 1/7)
  12.  
  13. function Animateeyeofcthulhu()
  14.     eyeofcthulhu.rotation = 10*math.sin(Time.time + 2)
  15. end
Add Comment
Please, Sign In to add comment