diff options
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); - } - } } |
