summaryrefslogtreecommitdiff
path: root/scripts/map/Tile.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-08-25 17:26:01 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-08-25 17:26:01 -0300
commit35660f002898cd2382567696890d3fbc4d21e763 (patch)
tree5b69cd8857e60b614ad01344abfb48400d6dd25c /scripts/map/Tile.cs
parent832fe5e98842123bcc9d0c3245babf172bb10578 (diff)
FOV
Diffstat (limited to 'scripts/map/Tile.cs')
-rw-r--r--scripts/map/Tile.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/map/Tile.cs b/scripts/map/Tile.cs
index 865cbbd..e050701 100644
--- a/scripts/map/Tile.cs
+++ b/scripts/map/Tile.cs
@@ -6,10 +6,34 @@ public partial class Tile : Sprite2D
private TileDefinition definition;
public bool IsWalkable { get; private set; }
+ public bool IsTransparent { get; private set; }
+
+ private bool isExplored = false;
+ public bool IsExplored {
+ get => this.isExplored;
+ set {
+ isExplored = value;
+ if (IsExplored && !Visible) {
+ Visible = true;
+ }
+ }
+ }
+
+ private bool isInView = false;
+ public bool IsInView {
+ get => this.isInView;
+ set {
+ this.isInView = value;
+ if (IsInView && !IsExplored) {
+ IsExplored = true;
+ }
+ }
+ }
public Tile(Vector2I pos, TileDefinition definition)
{
Centered = false;
+ Visible = false;
Position = Grid.GridToWorld(pos);
SetDefinition(definition);
}
@@ -18,5 +42,6 @@ public partial class Tile : Sprite2D
this.definition = definition;
Texture = definition.Texture;
IsWalkable = definition.IsWalkable;
+ IsTransparent = definition.IsTransparent;
}
}