From 35660f002898cd2382567696890d3fbc4d21e763 Mon Sep 17 00:00:00 2001 From: Matheus Date: Mon, 25 Aug 2025 17:26:01 -0300 Subject: FOV --- scripts/map/Tile.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'scripts/map/Tile.cs') 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; } } -- cgit v1.2.3