Guest User

Untitled

a guest
Aug 6th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 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. toddtodd = CreateSprite("Todd/Todd")
  5. toddwings = CreateSprite("Todd/Wings")
  6. --We parent the torso to the legs, so when you move the legs, the torso moves too.
  7. --We do the same for attaching the head to the torso.
  8.  
  9.  
  10. --Now we adjust the height for the individual parts so they look more like a skeleton and less like a pile of bones.
  11. toddtodd.y = 350
  12. toddtodd.x = 300
  13. toddwings.y = 400 --The torso's height is relative to the legs they're parented to.
  14. toddwings.x = 300 --The head's height is relative to the torso it's parented to.
  15.  
  16. --We set the torso's pivot point to halfway horizontally, and on the bottom vertically,
  17. --so we can rotate it around the bottom instead of the center.
  18.  
  19.  
  20. --We set the torso's anchor point to the top center. Because the legs are pivoted on the bottom (so rescaling them only makes them move up),
  21. --we want the torso to move along upwards with them.
  22.  
  23.  
  24. --Finally, we do some frame-by-frame animation just to show off the feature. You put in a list of sprites,
  25. --and the time you want a sprite change to take. In this case, it's 1/2 of a second.
Add Comment
Please, Sign In to add comment