summaryrefslogtreecommitdiff
path: root/scripts/map/Tile.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/map/Tile.cs')
-rw-r--r--scripts/map/Tile.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/map/Tile.cs b/scripts/map/Tile.cs
new file mode 100644
index 0000000..c910b01
--- /dev/null
+++ b/scripts/map/Tile.cs
@@ -0,0 +1,22 @@
+using Godot;
+using System;
+
+public partial class Tile : Sprite2D
+{
+ private TileDefinition definition;
+
+ public bool IsWalkable { get; set; }
+
+ public Tile(Vector2I pos, TileDefinition definition)
+ {
+ Centered = false;
+ Position = Grid.GridToWorld(pos);
+ SetDefinition(definition);
+ }
+
+ public void SetDefinition(TileDefinition definition) {
+ this.definition = definition;
+ Texture = definition.Texture;
+ this.IsWalkable = definition.IsWalkable;
+ }
+}