fix clunky actor sprite positioning

This commit is contained in:
2021-12-31 16:33:01 -07:00
parent 097d967a06
commit 3505dd026b

View File

@@ -32,7 +32,7 @@
(method :Void showCharacter [:Character<FlxStagePosition,FlxStageFacing,ActorFlxSprite> character :Appearance appearance :Continuation cc]
// TODO on the first appearance, show name and description (maybe? also probably not for all?)
// TODO also allow for manually defined flipped frames so text doesn't mirror
// TODO also allow for manually defined flipped frames so text on clothing doesn't mirror
(set character.actor.flipX ?!(= character.stageFacing character.actor.defaultFacing))
(character.actor.setGraphicSize ACTOR_WIDTH)
(character.actor.updateHitbox)
@@ -45,6 +45,9 @@
(otherwise (throw "unsupported stage position")))
(/ character.actor.width 2)))
(set character.actor.y ACTOR_Y)
(let [bottom (+ character.actor.y character.actor.height)]
(when (> bottom 720)
(-= character.actor.y (- bottom 720))))
(currentState.add character.actor)
(cc))