v0.5.0: updated display logic and texturing for sewers, caves, city.
This commit is contained in:
parent
ba0392e684
commit
17b03b4dc6
Binary file not shown.
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 13 KiB |
Binary file not shown.
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 14 KiB |
Binary file not shown.
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.traps.ToxicTrap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTileSheet;
|
||||||
import com.watabou.noosa.Camera;
|
import com.watabou.noosa.Camera;
|
||||||
import com.watabou.noosa.Group;
|
import com.watabou.noosa.Group;
|
||||||
import com.watabou.noosa.audio.Sample;
|
import com.watabou.noosa.audio.Sample;
|
||||||
|
@ -184,9 +185,11 @@ public class CavesBossLevel extends Level {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i < length(); i++) {
|
for (int i=0; i < length() - width(); i++) {
|
||||||
if (map[i] == Terrain.WALL && Random.Int( 8 ) == 0) {
|
if (map[i] == Terrain.WALL
|
||||||
|
&& DungeonTileSheet.floorTile(map[i + width()])
|
||||||
|
&& Random.Int( 3 ) == 0) {
|
||||||
map[i] = Terrain.WALL_DECO;
|
map[i] = Terrain.WALL_DECO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTileSheet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Blacksmith;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type;
|
||||||
|
@ -180,8 +181,10 @@ public class CavesLevel extends RegularLevel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i=0; i < length(); i++) {
|
for (int i=0; i < length() - width(); i++) {
|
||||||
if (map[i] == Terrain.WALL && Random.Int( 12 ) == 0) {
|
if (map[i] == Terrain.WALL &&
|
||||||
|
DungeonTileSheet.floorTile(map[i + width()])
|
||||||
|
&& Random.Int( 4 ) == 0) {
|
||||||
map[i] = Terrain.WALL_DECO;
|
map[i] = Terrain.WALL_DECO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.keys.SkeletonKey;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTileSheet;
|
||||||
import com.watabou.noosa.Group;
|
import com.watabou.noosa.Group;
|
||||||
import com.watabou.noosa.tweeners.AlphaTweener;
|
import com.watabou.noosa.tweeners.AlphaTweener;
|
||||||
import com.watabou.utils.Bundle;
|
import com.watabou.utils.Bundle;
|
||||||
|
@ -49,7 +50,7 @@ public class CityBossLevel extends Level {
|
||||||
private static final int TOP = 2;
|
private static final int TOP = 2;
|
||||||
private static final int HALL_WIDTH = 7;
|
private static final int HALL_WIDTH = 7;
|
||||||
private static final int HALL_HEIGHT = 15;
|
private static final int HALL_HEIGHT = 15;
|
||||||
private static final int CHAMBER_HEIGHT = 3;
|
private static final int CHAMBER_HEIGHT = 4;
|
||||||
|
|
||||||
private static final int WIDTH = 32;
|
private static final int WIDTH = 32;
|
||||||
|
|
||||||
|
@ -117,10 +118,12 @@ public class CityBossLevel extends Level {
|
||||||
map[arenaDoor] = Terrain.DOOR;
|
map[arenaDoor] = Terrain.DOOR;
|
||||||
|
|
||||||
Painter.fill( this, LEFT, TOP + HALL_HEIGHT + 1, HALL_WIDTH, CHAMBER_HEIGHT, Terrain.EMPTY );
|
Painter.fill( this, LEFT, TOP + HALL_HEIGHT + 1, HALL_WIDTH, CHAMBER_HEIGHT, Terrain.EMPTY );
|
||||||
|
Painter.fill( this, LEFT, TOP + HALL_HEIGHT + 1, HALL_WIDTH, 1, Terrain.BOOKSHELF);
|
||||||
|
map[arenaDoor + width()] = Terrain.EMPTY;
|
||||||
Painter.fill( this, LEFT, TOP + HALL_HEIGHT + 1, 1, CHAMBER_HEIGHT, Terrain.BOOKSHELF );
|
Painter.fill( this, LEFT, TOP + HALL_HEIGHT + 1, 1, CHAMBER_HEIGHT, Terrain.BOOKSHELF );
|
||||||
Painter.fill( this, LEFT + HALL_WIDTH - 1, TOP + HALL_HEIGHT + 1, 1, CHAMBER_HEIGHT, Terrain.BOOKSHELF );
|
Painter.fill( this, LEFT + HALL_WIDTH - 1, TOP + HALL_HEIGHT + 1, 1, CHAMBER_HEIGHT, Terrain.BOOKSHELF );
|
||||||
|
|
||||||
entrance = (TOP + HALL_HEIGHT + 2 + Random.Int( CHAMBER_HEIGHT - 1 )) * width() + LEFT + (/*1 +*/ Random.Int( HALL_WIDTH-2 ));
|
entrance = (TOP + HALL_HEIGHT + 3 + Random.Int( CHAMBER_HEIGHT - 2 )) * width() + LEFT + (/*1 +*/ Random.Int( HALL_WIDTH-2 ));
|
||||||
map[entrance] = Terrain.ENTRANCE;
|
map[entrance] = Terrain.ENTRANCE;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -128,16 +131,18 @@ public class CityBossLevel extends Level {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void decorate() {
|
protected void decorate() {
|
||||||
|
|
||||||
for (int i=0; i < length(); i++) {
|
for (int i=0; i < length() - width(); i++) {
|
||||||
if (map[i] == Terrain.EMPTY && Random.Int( 10 ) == 0) {
|
if (map[i] == Terrain.EMPTY && Random.Int( 10 ) == 0) {
|
||||||
map[i] = Terrain.EMPTY_DECO;
|
map[i] = Terrain.EMPTY_DECO;
|
||||||
} else if (map[i] == Terrain.WALL && Random.Int( 8 ) == 0) {
|
} else if (map[i] == Terrain.WALL
|
||||||
|
&& DungeonTileSheet.floorTile(map[i + width()])
|
||||||
|
&& Random.Int( 21 - Dungeon.depth ) == 0) {
|
||||||
map[i] = Terrain.WALL_DECO;
|
map[i] = Terrain.WALL_DECO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int sign = arenaDoor + width() + 1;
|
int sign = arenaDoor + 2*width() + 1;
|
||||||
map[sign] = Terrain.SIGN;
|
map[sign] = Terrain.SIGN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.levels;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTileSheet;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
import com.shatteredpixel.shatteredpixeldungeon.tiles.DungeonTilemap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Imp;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Room.Type;
|
||||||
|
@ -107,10 +108,12 @@ public class CityLevel extends RegularLevel {
|
||||||
@Override
|
@Override
|
||||||
protected void decorate() {
|
protected void decorate() {
|
||||||
|
|
||||||
for (int i=0; i < length(); i++) {
|
for (int i=0; i < length() - width(); i++) {
|
||||||
if (map[i] == Terrain.EMPTY && Random.Int( 10 ) == 0) {
|
if (map[i] == Terrain.EMPTY && Random.Int( 10 ) == 0) {
|
||||||
map[i] = Terrain.EMPTY_DECO;
|
map[i] = Terrain.EMPTY_DECO;
|
||||||
} else if (map[i] == Terrain.WALL && Random.Int( 8 ) == 0) {
|
} else if (map[i] == Terrain.WALL
|
||||||
|
&& DungeonTileSheet.floorTile(map[i + width()])
|
||||||
|
&& Random.Int( 21 - Dungeon.depth ) == 0) {
|
||||||
map[i] = Terrain.WALL_DECO;
|
map[i] = Terrain.WALL_DECO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -193,7 +196,7 @@ public class CityLevel extends RegularLevel {
|
||||||
this.pos = pos;
|
this.pos = pos;
|
||||||
|
|
||||||
PointF p = DungeonTilemap.tileCenterToWorld( pos );
|
PointF p = DungeonTilemap.tileCenterToWorld( pos );
|
||||||
pos( p.x - 4, p.y - 2, 4, 0 );
|
pos( p.x - 6, p.y - 4, 12, 12 );
|
||||||
|
|
||||||
pour( factory, 0.2f );
|
pour( factory, 0.2f );
|
||||||
}
|
}
|
||||||
|
@ -212,7 +215,7 @@ public class CityLevel extends RegularLevel {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
color( 0x000000 );
|
color( 0x000000 );
|
||||||
speed.set( Random.Float( 8 ), -Random.Float( 8 ) );
|
speed.set( Random.Float( -2, 4 ), -Random.Float( 3, 6 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reset( float x, float y ) {
|
public void reset( float x, float y ) {
|
||||||
|
@ -229,7 +232,7 @@ public class CityLevel extends RegularLevel {
|
||||||
super.update();
|
super.update();
|
||||||
float p = left / lifespan;
|
float p = left / lifespan;
|
||||||
am = p > 0.8f ? 1 - p : p * 0.25f;
|
am = p > 0.8f ? 1 - p : p * 0.25f;
|
||||||
size( 8 - p * 4 );
|
size( 6 - p * 3 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -103,6 +103,10 @@ public class DungeonTileSheet {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static boolean floorTile(int tile){
|
||||||
|
return tile < CHASM;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Chasm Tiles
|
* Chasm Tiles
|
||||||
|
|
Loading…
Reference in New Issue
Block a user