Fix animation bug
This commit is contained in:
@@ -20,8 +20,8 @@
|
||||
(set up (set down false)))
|
||||
(when (and left right)
|
||||
(set left (set right false)))
|
||||
(when (or up down left right)
|
||||
(deflocal &mut :Float newAngle 0)
|
||||
(if (or up down left right)
|
||||
(let [&mut :Float newAngle 0]
|
||||
(cond
|
||||
(up
|
||||
(set newAngle -90)
|
||||
@@ -46,7 +46,10 @@
|
||||
(set newAngle 0)
|
||||
(set facing FlxObject.RIGHT)))
|
||||
(velocity.set SPEED 0)
|
||||
(velocity.rotate (FlxPoint.weak 0 0) newAngle)))
|
||||
(velocity.rotate (FlxPoint.weak 0 0) newAngle))
|
||||
(when animation.curAnim
|
||||
(set animation.curAnim.curFrame 0)
|
||||
(animation.curAnim.pause)))
|
||||
// TODO != is not implemented. Not sure how it would work as a variadic, because other
|
||||
// Lisps don't have that either
|
||||
(when !(and (= 0 velocity.x) (= 0 velocity.y))
|
||||
@@ -59,7 +62,7 @@
|
||||
(animation.play "d"))
|
||||
(otherwise
|
||||
(return))))
|
||||
(return))
|
||||
(return)))
|
||||
|
||||
(defmethod &override update [:Float elapsed]
|
||||
(updateMovement)
|
||||
|
Reference in New Issue
Block a user