Merging Source v1.7.2: sprite changes
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user