summaryrefslogtreecommitdiff
path: root/scripts/actors/actions/MovementAction.cs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/actors/actions/MovementAction.cs')
-rw-r--r--scripts/actors/actions/MovementAction.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/actors/actions/MovementAction.cs b/scripts/actors/actions/MovementAction.cs
index 704dd4f..f86d542 100644
--- a/scripts/actors/actions/MovementAction.cs
+++ b/scripts/actors/actions/MovementAction.cs
@@ -1,6 +1,8 @@
using Godot;
-using System;
+/// <summary>
+/// Ação de movimento. Movimenta o ator para a direção de seu Offset.
+/// </summary>
public partial class MovementAction : DirectionalAction
{
public MovementAction(Actor actor, Vector2I offset) : base(actor, offset)
@@ -11,12 +13,13 @@ public partial class MovementAction : DirectionalAction
{
Vector2I finalDestination = actor.GridPosition + Offset;
+ // Não anda se o destino for um tile sólido.
if (!Map_Data.IsTileWalkable(finalDestination)) return;
+ // Não anda se o destino for oculpado por um ator.
+ // Na maioria dos casos, essa condição nunca é verdadeira.
if (GetBlockingActorAtPosition(finalDestination) != null) return;
- GD.Print("What?");
-
actor.Walk(Offset);
}
}