v0.4.3: updated some visual effects for plants and grass
This commit is contained in:
parent
aa741a45b7
commit
80e1182811
|
@ -54,14 +54,11 @@ public class Fire extends Blob {
|
|||
fire = cur[cell] - 1;
|
||||
if (fire <= 0 && flamable[cell]) {
|
||||
|
||||
int oldTile = Dungeon.level.map[cell];
|
||||
Dungeon.level.destroy( cell );
|
||||
|
||||
observe = true;
|
||||
GameScene.updateMap( cell );
|
||||
if (Dungeon.visible[cell]) {
|
||||
GameScene.discoverTile( cell, oldTile );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -739,7 +739,7 @@ public abstract class Level implements Bundlable {
|
|||
plant = seed.couch( pos );
|
||||
plants.put( pos, plant );
|
||||
|
||||
GameScene.updateMap( pos );
|
||||
GameScene.plantSeed( pos );
|
||||
|
||||
return plant;
|
||||
}
|
||||
|
|
|
@ -686,6 +686,12 @@ public class GameScene extends PixelScene {
|
|||
scene.terrainFeatures.updateMapCell( cell );
|
||||
}
|
||||
}
|
||||
|
||||
public static void plantSeed( int cell ) {
|
||||
if (scene != null) {
|
||||
scene.terrainFeatures.growPlant( cell );
|
||||
}
|
||||
}
|
||||
|
||||
public static void discoverTile( int pos, int oldValue ) {
|
||||
if (scene != null) {
|
||||
|
|
|
@ -22,16 +22,22 @@ package com.shatteredpixel.shatteredpixeldungeon.ui;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
|
||||
import com.watabou.noosa.Image;
|
||||
import com.watabou.noosa.TextureFilm;
|
||||
import com.watabou.noosa.Tilemap;
|
||||
import com.watabou.noosa.tweeners.AlphaTweener;
|
||||
import com.watabou.noosa.tweeners.ScaleTweener;
|
||||
import com.watabou.utils.PathFinder;
|
||||
import com.watabou.utils.PointF;
|
||||
import com.watabou.utils.Random;
|
||||
import com.watabou.utils.SparseArray;
|
||||
|
||||
import static com.shatteredpixel.shatteredpixeldungeon.DungeonTilemap.tileToWorld;
|
||||
|
||||
//TODO add in a proper set of vfx for plants growing/withering, grass burning, discovering traps
|
||||
public class TerrainFeaturesTilemap extends Tilemap {
|
||||
|
||||
|
@ -123,6 +129,23 @@ public class TerrainFeaturesTilemap extends Tilemap {
|
|||
return img;
|
||||
}
|
||||
|
||||
public void growPlant( final int pos ){
|
||||
final Image plant = tile( pos, map[pos] );
|
||||
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);
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean overlapsPoint( float x, float y ) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user