diff options
| author | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-16 14:22:04 -0300 |
|---|---|---|
| committer | Matheus <matheus.guedes.mg.m@gmail.com> | 2025-08-16 14:22:04 -0300 |
| commit | c411c496394c7a782854e03f2be8fab4cc1e2a81 (patch) | |
| tree | 6cecaa0f70c9b3fd49a9fce9b383d46c27c41dcd /scripts/Character.cs | |
| parent | 588a80a339a64f15b2e3bada550beb14e16abe3e (diff) | |
Herança e preparativos para o sistema de turnos
Diffstat (limited to 'scripts/Character.cs')
| -rw-r--r-- | scripts/Character.cs | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/scripts/Character.cs b/scripts/Character.cs index 1e11fcc..e3707f5 100644 --- a/scripts/Character.cs +++ b/scripts/Character.cs @@ -1,9 +1,7 @@ using Godot; using System; -public partial class Character : Sprite2D { - [Export] - public TileMapLayer map; +public partial class Character : Actor { public override void _Input(InputEvent @event) { @@ -30,16 +28,4 @@ public partial class Character : Sprite2D { Walk(offset); } } - - private void Walk(Vector2I offset) { - Vector2I toMovePos = map.LocalToMap(Position); - toMovePos += offset; - - TileData tile = map.GetCellTileData(toMovePos); - - if (tile.HasCustomData("isWalkable") && (bool) tile.GetCustomData("isWalkable")) { - GD.Print(toMovePos); - Position = map.MapToLocal(toMovePos); - } - } } |
