From c411c496394c7a782854e03f2be8fab4cc1e2a81 Mon Sep 17 00:00:00 2001 From: Matheus Date: Sat, 16 Aug 2025 14:22:04 -0300 Subject: Herança e preparativos para o sistema de turnos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/Character.cs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'scripts/Character.cs') 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); - } - } } -- cgit v1.2.3