Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --For usage, check out the encounter Lua's EncounterStarting() and Update() functions.
- -- First, we can create the torso, legs and head.
- toddtodd = CreateSprite("Todd/Todd")
- toddwings = CreateSprite("Todd/Wings")
- --We parent the torso to the legs, so when you move the legs, the torso moves too.
- --We do the same for attaching the head to the torso.
- --Now we adjust the height for the individual parts so they look more like a skeleton and less like a pile of bones.
- toddtodd.y = 350
- toddtodd.x = 300
- toddwings.y = 400 --The torso's height is relative to the legs they're parented to.
- toddwings.x = 300 --The head's height is relative to the torso it's parented to.
- --We set the torso's pivot point to halfway horizontally, and on the bottom vertically,
- --so we can rotate it around the bottom instead of the center.
- --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),
- --we want the torso to move along upwards with them.
- --Finally, we do some frame-by-frame animation just to show off the feature. You put in a list of sprites,
- --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