com.watabou.noosa.tweeners.Tweener Java Examples

The following examples show how to use com.watabou.noosa.tweeners.Tweener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CharSprite.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 6 votes vote down vote up
@Override
	public void onComplete( Tweener tweener ) {
		if (tweener == jumpTweener) {
			
//			if (visible && Level.water[ch.pos] && !ch.flying) {
//				GameScene.ripple( ch.pos );
//			}
			if (jumpCallback != null) {
				jumpCallback.call();
			}
			
		} else if (tweener == motion) {
			
			isMoving = false;
			
			motion.killAndErase();
			motion = null;
		}
	}
 
Example #2
Source File: CharSprite.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onComplete( Tweener tweener ) {
	if (tweener == jumpTweener) {

		if (visible && Level.water[ch.pos] && !ch.flying) {
			GameScene.ripple( ch.pos );
		}
		if (jumpCallback != null) {
			jumpCallback.call();
		}

	} else if (tweener == motion) {

		isMoving = false;

		motion.killAndErase();
		motion = null;
		ch.onMotionComplete();
	}
}
 
Example #3
Source File: CharSprite.java    From pixel-dungeon with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onComplete( Tweener tweener ) {
	if (tweener == jumpTweener) {
		
		if (visible && Level.water[ch.pos] && !ch.flying) {
			GameScene.ripple( ch.pos );
		}
		if (jumpCallback != null) {
			jumpCallback.call();
		}
		
	} else if (tweener == motion) {
		
		isMoving = false;
		
		motion.killAndErase();
		motion = null;
	}
}
 
Example #4
Source File: CharSprite.java    From shattered-pixel-dungeon with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onComplete( Tweener tweener ) {
	if (tweener == jumpTweener) {

		if (visible && Dungeon.level.water[ch.pos] && !ch.flying) {
			GameScene.ripple( ch.pos );
		}
		if (jumpCallback != null) {
			jumpCallback.call();
		}

	} else if (tweener == motion) {

		synchronized (this) {
			isMoving = false;

			motion.killAndErase();
			motion = null;
			ch.onMotionComplete();

			notifyAll();
		}

	}
}
 
Example #5
Source File: HeroSpriteDef.java    From remixed-dungeon with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onComplete(Tweener tweener) {

        if (tweener == jumpTweener) {
            ch.ifPresent(chr -> {
                if (getVisible() && Dungeon.level.water[chr.getPos()] && !chr.isFlying()) {
                    GameScene.ripple(chr.getPos());
                }
            });
            if (jumpCallback != null) {
                jumpCallback.call();
            }
        } else {
            super.onComplete(tweener);
        }
}
 
Example #6
Source File: CharSprite.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onComplete( Tweener tweener ) {
	if (tweener == jumpTweener) {

		if (visible && Dungeon.level.water[ch.pos] && !ch.flying) {
			GameScene.ripple( ch.pos );
		}
		if (jumpCallback != null) {
			jumpCallback.call();
		}

	} else if (tweener == motion) {

		synchronized (this) {
			isMoving = false;

			motion.killAndErase();
			motion = null;
			ch.onMotionComplete();

			notifyAll();
		}

	}
}
 
Example #7
Source File: Pushing.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected boolean act() {

	if (sprite != null) {

               PointF dest = sprite.worldToCamera( to );
               PointF d = PointF.diff( sprite.worldToCamera( from ), dest );

               PosTweener tweener = new PosTweener( sprite, dest, d.length() / SPEED );

               tweener.listener = new Tweener.Listener() {
                   @Override
                   public void onComplete( Tweener tweener ){
                       Actor.remove( Pushing.this );

                       if( callback != null ){
                           callback.call();
                       }

                       next();
                   }
               };

               sprite.parent.add( tweener );

		return false;

	} else {

		Actor.remove( Pushing.this );
		return true;
	}
}
 
Example #8
Source File: MissileSprite.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onComplete( Tweener tweener ) {
	kill();
	if (callback != null) {
		callback.call();
	}
}
 
Example #9
Source File: MissileSprite.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onComplete( Tweener tweener ) {
	kill();
	if (callback != null) {
		callback.call();
	}
}
 
Example #10
Source File: MissileSprite.java    From pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onComplete( Tweener tweener ) {
	kill();
	if (callback != null) {
		callback.call();
	}
}
 
Example #11
Source File: MissileSprite.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onComplete( Tweener tweener ) {
	kill();
	if (callback != null) {
		callback.call();
	}
}
 
Example #12
Source File: LevelObjectSprite.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public void move(int from, int to) {
	if (getParent() != null) {
		Tweener motion = new PosTweener(this, DungeonTilemap.tileToWorld(to).offset(centerShift), 0.1f);
		motion.listener = this;
		getParent().add(motion);

		if (getVisible() && Dungeon.level.water[from]) {
			GameScene.ripple(from);
		}
	}
}
 
Example #13
Source File: CharSprite.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onComplete(Tweener tweener) {
    if (tweener == motion) {
        motion.killAndErase();
        motion = null;

        isMoving = false;
        ch.ifPresent(chr -> {
            if (Actor.all().contains(chr)) {
                chr.onMotionComplete();
                place(chr.getPos());
            }
        });
    }
}
 
Example #14
Source File: MissileSprite.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onComplete( Tweener tweener ) {
	kill();
	if (callback != null) {
		callback.call();
	}
}
 
Example #15
Source File: MissileSprite.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onComplete( Tweener tweener ) {
	kill();
	if (callback != null) {
		callback.call();
	}
}
 
Example #16
Source File: LevelObjectSprite.java    From remixed-dungeon with GNU General Public License v3.0 2 votes vote down vote up
@Override
public void onComplete(Tweener tweener) {

}