com.watabou.noosa.tweeners.ScaleTweener Java Examples

The following examples show how to use com.watabou.noosa.tweeners.ScaleTweener. 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: FieryRune.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 6 votes vote down vote up
public void explode() {

            if (burning != null) {
                burning.on = false;
                burning = null;
            }

            parent.add(new ScaleTweener( this, new PointF(2, 2), ANIM_TIME ) {
                @Override
                protected void onComplete() {

                    RuneSprite.this.killAndErase();
                    parent.erase( this );

                }

                @Override
                protected void updateValues(float progress) {
                    super.updateValues(progress);
                    am = 1 - progress;
                }
            });
        }
 
Example #2
Source File: SpiderWeb.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 6 votes vote down vote up
public void trigger() {

            parent.add(new ScaleTweener( this, new PointF(2, 2), ANIM_TIME ) {
                @Override
                protected void onComplete() {

                    WebbingSprite.this.killAndErase();
                    parent.erase( this );

                }

                @Override
                protected void updateValues(float progress) {
                    super.updateValues(progress);
                    am = 1 - progress;
                }
            });
        }
 
Example #3
Source File: MobSprite.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 6 votes vote down vote up
public void fall() {
	
	origin.set( width / 2, height - DungeonTilemap.SIZE / 2 );
	angularSpeed = Random.Int( 2 ) == 0 ? -720 : 720;
	
	parent.add(new ScaleTweener(this, new PointF(0, 0), FALL_TIME) {
           @Override
           protected void onComplete() {
               MobSprite.this.killAndErase();
               parent.erase(this);
           }

           ;

           @Override
           protected void updateValues(float progress) {
               super.updateValues(progress);
               am = 1 - progress;
           }
       });
}
 
Example #4
Source File: MobSprite.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 6 votes vote down vote up
public void fall() {
	
	origin.set( width / 2, height - DungeonTilemap.SIZE / 2 );
	angularSpeed = Random.Int( 2 ) == 0 ? -720 : 720;
	
	parent.add( new ScaleTweener( this, new PointF( 0, 0 ), FALL_TIME ) {
		@Override
		protected void onComplete() {
			MobSprite.this.killAndErase();
			parent.erase( this );
		};
		@Override
		protected void updateValues( float progress ) {
			super.updateValues( progress );
			am = 1 - progress;
		}
	} );
}
 
Example #5
Source File: MobSprite.java    From pixel-dungeon with GNU General Public License v3.0 6 votes vote down vote up
public void fall() {
	
	origin.set( width / 2, height - DungeonTilemap.SIZE / 2 );
	angularSpeed = Random.Int( 2 ) == 0 ? -720 : 720;
	
	parent.add( new ScaleTweener( this, new PointF( 0, 0 ), FALL_TIME ) {
		@Override
		protected void onComplete() {
			MobSprite.this.killAndErase();
			parent.erase( this );
		};
		@Override
		protected void updateValues( float progress ) {
			super.updateValues( progress );
			am = 1 - progress;
		}
	} );
}
 
Example #6
Source File: TerrainFeaturesTilemap.java    From shattered-pixel-dungeon with GNU General Public License v3.0 6 votes vote down vote up
public void growPlant( final int pos ){
	final Image plant = tile( pos, map[pos] );
	if (plant == null) return;
	
	plant.origin.set( 8, 12 );
	plant.scale.set( 0 );
	plant.point( DungeonTilemap.tileToWorld( pos ) );

	parent.add( plant );

	parent.add( new ScaleTweener( plant, new PointF(1, 1), 0.2f ) {
		protected void onComplete() {
			plant.killAndErase();
			killAndErase();
			updateMapCell(pos);
		}
	} );
}
 
Example #7
Source File: MobSprite.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 6 votes vote down vote up
public void fall() {
	
	origin.set( width / 2, height - DungeonTilemap.SIZE / 2 );
	angularSpeed = Random.Int( 2 ) == 0 ? -720 : 720;
	
	parent.add( new ScaleTweener( this, new PointF( 0, 0 ), FALL_TIME ) {
		@Override
		protected void onComplete() {
			MobSprite.this.killAndErase();
			parent.erase( this );
		}
		@Override
		protected void updateValues( float progress ) {
			super.updateValues( progress );
			am = 1 - progress;
		}
	} );
}
 
Example #8
Source File: TerrainFeaturesTilemap.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 6 votes vote down vote up
public void growPlant( final int pos ){
	final Image plant = tile( pos, map[pos] );
	if (plant == null) return;
	
	plant.origin.set( 8, 12 );
	plant.scale.set( 0 );
	plant.point( DungeonTilemap.tileToWorld( pos ) );

	parent.add( plant );

	parent.add( new ScaleTweener( plant, new PointF(1, 1), 0.2f ) {
		protected void onComplete() {
			plant.killAndErase();
			killAndErase();
			updateMapCell(pos);
		}
	} );
}
 
Example #9
Source File: MobSprite.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public void fall() {
	
	origin.set( width / 2, height - DungeonTilemap.SIZE / 2 );
	angularSpeed = Random.Int( 2 ) == 0 ? -720 : 720;
	am = 1;

	if (emo != null){
		emo.killAndErase();
	}

	if (health != null){
		health.killAndErase();
	}
	
	parent.add( new ScaleTweener( this, new PointF( 0, 0 ), FALL_TIME ) {
		@Override
		protected void onComplete() {
			MobSprite.this.killAndErase();
			parent.erase( this );
		}
		@Override
		protected void updateValues( float progress ) {
			super.updateValues( progress );
			y += 12 * Game.elapsed;
			am = 1 - progress;
		}
	} );
}