summaryrefslogtreecommitdiff
path: root/scripts/map/MapData.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-08-24 21:46:00 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-08-24 21:46:00 -0300
commitefb712cb70ca1d0913bb69456ac2344fbaacad0e (patch)
treef59a1ce426ed8ee9373b1577126c55c8017dbc4a /scripts/map/MapData.cs
parent723e66a82606ee78ca4156a0c0a850185b4c0369 (diff)
Gerador de masmorras.
Diffstat (limited to 'scripts/map/MapData.cs')
-rw-r--r--scripts/map/MapData.cs16
1 files changed, 4 insertions, 12 deletions
diff --git a/scripts/map/MapData.cs b/scripts/map/MapData.cs
index 25d6e09..c580aa8 100644
--- a/scripts/map/MapData.cs
+++ b/scripts/map/MapData.cs
@@ -22,24 +22,16 @@ public partial class MapData : RefCounted
}
private void SetupTiles() {
- for (int i = 0; i < Width; i++)
+ for (int i = 0; i < Height; i++)
{
- for (int j = 0; j < Height; j++)
+ for (int j = 0; j < Width; j++)
{
- Tile tile;
- if (i == 0 || j == 0 || i == (Width - 1) || j == (Height - 1)) {
- tile = new Tile(new Vector2I(i, j), wallDefinition);
- } else {
- tile = new Tile(new Vector2I(i, j), floorDefinition);
- }
-
- Tiles.Add(tile);
+ Tiles.Add(new Tile(new Vector2I(j, i), wallDefinition));
}
}
}
- public void InsertActor(Vector2I pos, Actor actor) {
- actor.GridPosition = pos;
+ public void InsertActor(Actor actor) {
Actors.Add(actor);
}