Merging Source v1.7.2: sprite changes

This commit is contained in:
Evan Debenham
2014-10-20 20:12:43 -04:00
parent 33db534e25
commit 9f49d115d2
8 changed files with 96 additions and 11 deletions
@@ -82,6 +82,9 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
// Char owner
public Char ch;
// The sprite is currently in motion
public boolean isMoving = false;
public CharSprite() {
super();
@@ -135,12 +138,16 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
motion = new PosTweener( this, worldToCamera( to ), MOVE_INTERVAL );
motion.listener = this;
parent.add( motion );
isMoving = true;
turnTo( from , to );
if (visible && Level.water[from] && !ch.flying) {
GameScene.ripple( from );
}
ch.onMotionComplete();
}
public void interruptMotion() {
@@ -377,6 +384,9 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip
@Override
public void onComplete( Tweener tweener ) {
if (tweener == motion) {
isMoving = false;
motion.killAndErase();
motion = null;
ch.onMotionComplete();