v0.5.0: fog of war and tile blocking now update when a tile is discovered
This commit is contained in:
parent
c2aaae4549
commit
b994e20a08
|
@ -228,17 +228,6 @@ public class GameScene extends PixelScene {
|
|||
mob.beckon( Dungeon.hero.pos );
|
||||
}
|
||||
}
|
||||
|
||||
add( emitters );
|
||||
add( effects );
|
||||
|
||||
gases = new Group();
|
||||
add( gases );
|
||||
|
||||
for (Blob blob : Dungeon.level.blobs.values()) {
|
||||
blob.emitter = null;
|
||||
addBlobSprite( blob );
|
||||
}
|
||||
|
||||
walls = new DungeonWallsTilemap();
|
||||
add(walls);
|
||||
|
@ -246,6 +235,18 @@ public class GameScene extends PixelScene {
|
|||
wallBlocking = new WallBlockingTilemap();
|
||||
add (wallBlocking);
|
||||
|
||||
add( emitters );
|
||||
add( effects );
|
||||
|
||||
gases = new Group();
|
||||
add( gases );
|
||||
|
||||
for (Blob blob : Dungeon.level.blobs.values()) {
|
||||
blob.emitter = null;
|
||||
addBlobSprite( blob );
|
||||
}
|
||||
|
||||
|
||||
fog = new FogOfWar( Dungeon.level.width(), Dungeon.level.height() );
|
||||
add( fog );
|
||||
|
||||
|
@ -707,6 +708,8 @@ public class GameScene extends PixelScene {
|
|||
scene.tiles.updateMapCell( cell );
|
||||
scene.terrainFeatures.updateMapCell( cell );
|
||||
scene.walls.updateMapCell( cell );
|
||||
scene.fog.updateFogCell( cell );
|
||||
scene.wallBlocking.updateMapCell( cell );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -119,6 +119,10 @@ public class FogOfWar extends Image {
|
|||
updated.set( 0, 0, mapWidth, mapHeight );
|
||||
}
|
||||
|
||||
public synchronized void updateFogCell( int cell ){
|
||||
updated.set( cell % mapWidth , cell / mapHeight, (cell % mapWidth)+1, (cell / mapHeight)+1 );
|
||||
}
|
||||
|
||||
public synchronized void updateFogArea(int x, int y, int w, int h){
|
||||
updated.union(x, y);
|
||||
updated.union(x + w, y + h);
|
||||
|
|
Loading…
Reference in New Issue
Block a user