Dungeon Building p8
This commit is contained in:
@@ -436,7 +436,7 @@ public class DungeonGeneratorV2
|
|||||||
if (x >= 0 && x < MapWidth && ty >= 0 && ty < MapHeight && layout.Tiles[x, ty] == 0)
|
if (x >= 0 && x < MapWidth && ty >= 0 && ty < MapHeight && layout.Tiles[x, ty] == 0)
|
||||||
{
|
{
|
||||||
layout.Tiles[x, ty] = floorId;
|
layout.Tiles[x, ty] = floorId;
|
||||||
if (floorId > 1)
|
if (floorId > 0 && sheetId > 0)
|
||||||
{
|
{
|
||||||
layout.TileDetails.Add(new PlacedTile
|
layout.TileDetails.Add(new PlacedTile
|
||||||
{
|
{
|
||||||
@@ -465,7 +465,7 @@ public class DungeonGeneratorV2
|
|||||||
if (tx >= 0 && tx < MapWidth && y >= 0 && y < MapHeight && layout.Tiles[tx, y] == 0)
|
if (tx >= 0 && tx < MapWidth && y >= 0 && y < MapHeight && layout.Tiles[tx, y] == 0)
|
||||||
{
|
{
|
||||||
layout.Tiles[tx, y] = floorId;
|
layout.Tiles[tx, y] = floorId;
|
||||||
if (floorId > 1)
|
if (floorId > 0 && sheetId > 0)
|
||||||
{
|
{
|
||||||
layout.TileDetails.Add(new PlacedTile
|
layout.TileDetails.Add(new PlacedTile
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -92,10 +92,10 @@ public class DungeonSimulation
|
|||||||
|
|
||||||
foreach (var (tileX, tileY) in cornerPositions)
|
foreach (var (tileX, tileY) in cornerPositions)
|
||||||
{
|
{
|
||||||
// Check if this is a valid floor tile
|
// Check if this is a valid floor tile (non-zero = walkable)
|
||||||
if (tileX >= 0 && tileX < Layout.Width &&
|
if (tileX >= 0 && tileX < Layout.Width &&
|
||||||
tileY >= 0 && tileY < Layout.Height &&
|
tileY >= 0 && tileY < Layout.Height &&
|
||||||
Layout.Tiles[tileX, tileY] == 1) // 1 = floor
|
Layout.Tiles[tileX, tileY] != 0) // non-zero = floor
|
||||||
{
|
{
|
||||||
// Check surrounding tiles to avoid placing near hallways
|
// Check surrounding tiles to avoid placing near hallways
|
||||||
bool nearHallway = false;
|
bool nearHallway = false;
|
||||||
@@ -113,7 +113,7 @@ public class DungeonSimulation
|
|||||||
checkY < entranceRoom.Y ||
|
checkY < entranceRoom.Y ||
|
||||||
checkY >= entranceRoom.Y + entranceRoom.Height;
|
checkY >= entranceRoom.Y + entranceRoom.Height;
|
||||||
|
|
||||||
if (outsideRoom && Layout.Tiles[checkX, checkY] == 1) // Floor outside room = hallway
|
if (outsideRoom && Layout.Tiles[checkX, checkY] != 0) // Floor outside room = hallway
|
||||||
{
|
{
|
||||||
nearHallway = true;
|
nearHallway = true;
|
||||||
}
|
}
|
||||||
@@ -148,7 +148,7 @@ public class DungeonSimulation
|
|||||||
|
|
||||||
if (portalTileX >= 0 && portalTileX < Layout.Width &&
|
if (portalTileX >= 0 && portalTileX < Layout.Width &&
|
||||||
portalTileY >= 0 && portalTileY < Layout.Height &&
|
portalTileY >= 0 && portalTileY < Layout.Height &&
|
||||||
Layout.Tiles[portalTileX, portalTileY] == 1)
|
Layout.Tiles[portalTileX, portalTileY] != 0)
|
||||||
{
|
{
|
||||||
var portal = new PortalInstance
|
var portal = new PortalInstance
|
||||||
{
|
{
|
||||||
@@ -1015,7 +1015,8 @@ public class DungeonSimulation
|
|||||||
if (tileX < 0 || tileX >= Layout.Width || tileY < 0 || tileY >= Layout.Height)
|
if (tileX < 0 || tileX >= Layout.Width || tileY < 0 || tileY >= Layout.Height)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return Layout.Tiles[tileX, tileY] == 1;
|
// Any non-zero tile is walkable (0 = void/wall, >0 = floor tile ID or 1 for basic floor)
|
||||||
|
return Layout.Tiles[tileX, tileY] != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MoveToward(MobInstance mob, float targetX, float targetY, float speed)
|
private void MoveToward(MobInstance mob, float targetX, float targetY, float speed)
|
||||||
|
|||||||
Reference in New Issue
Block a user