summaryrefslogtreecommitdiff
path: root/scripts/actors/actions/MovementAction.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-08-28 00:38:48 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-08-28 00:38:48 -0300
commit2fb787a744d4f7a37d81233d2913a5ef39122f73 (patch)
treef9595d6757203146aa8201a86275c2c842bae03b /scripts/actors/actions/MovementAction.cs
parent6c7e2ac133986efa57b43df52a5498c6f7efcf75 (diff)
Comentarios
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);
}
}