remove tweens of removed props and actors
This commit is contained in:
@@ -53,9 +53,16 @@
|
|||||||
(tweenedPositions.remove (dictGet actors actorName)))
|
(tweenedPositions.remove (dictGet actors actorName)))
|
||||||
(super.moveCharacter actorName newPosition newFacing cc))
|
(super.moveCharacter actorName newPosition newFacing cc))
|
||||||
|
|
||||||
|
(method removeTweensOf [:FlxSprite actorOrProp]
|
||||||
|
(doFor tween (reverse tweens)
|
||||||
|
(when (callPrivate tween "isTweenOf" actorOrProp)
|
||||||
|
(tweens.remove tween))))
|
||||||
|
|
||||||
(method &override removeCharacter [actorName :Continuation cc]
|
(method &override removeCharacter [actorName :Continuation cc]
|
||||||
(whenLet [tweenedPositions (dictGet tweenedPositionsOfSpritesInScenes sceneKey)]
|
(let [actor (dictGet actors actorName)]
|
||||||
(tweenedPositions.remove (dictGet actors actorName)))
|
(removeTweensOf actor)
|
||||||
|
(whenLet [tweenedPositions (dictGet tweenedPositionsOfSpritesInScenes sceneKey)]
|
||||||
|
(tweenedPositions.remove actor)))
|
||||||
(super.removeCharacter actorName cc))
|
(super.removeCharacter actorName cc))
|
||||||
|
|
||||||
(method &override addProp [name :Dynamic position :Continuation cc]
|
(method &override addProp [name :Dynamic position :Continuation cc]
|
||||||
@@ -65,6 +72,7 @@
|
|||||||
|
|
||||||
(method &override removeProp [name :Continuation cc]
|
(method &override removeProp [name :Continuation cc]
|
||||||
(let [prop (dictGet props name)]
|
(let [prop (dictGet props name)]
|
||||||
|
(removeTweensOf prop)
|
||||||
(whenLet [tweenedPositions (dictGet tweenedPositionsOfSpritesInScenes sceneKey)]
|
(whenLet [tweenedPositions (dictGet tweenedPositionsOfSpritesInScenes sceneKey)]
|
||||||
(tweenedPositions.remove prop))
|
(tweenedPositions.remove prop))
|
||||||
(whenLet [overlaidProps (dictGet overlaidPropsInScenes sceneKey)]
|
(whenLet [overlaidProps (dictGet overlaidPropsInScenes sceneKey)]
|
||||||
|
Reference in New Issue
Block a user