mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:55:35 +00:00
Restored enemy animations
This commit is contained in:
parent
57eb6d1724
commit
e85930df5e
3 changed files with 5 additions and 1 deletions
|
|
@ -134,7 +134,7 @@ _moduleNodes = [NodePath("../../AnimationModule")]
|
|||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
sprite_frames = ExtResource("10_514kd")
|
||||
animation = &"right"
|
||||
animation = &"down"
|
||||
|
||||
[node name="PlayerDetection" type="Area2D" parent="."]
|
||||
collision_layer = 0
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ public partial class Alert : EnemyStateBase
|
|||
NavigationModule.Move(StorageModule.EnemyData.MovementSpeed);
|
||||
|
||||
StorageModule.FacingDirection = MainObject.Velocity.SnapToCardinal().Normalized();
|
||||
StorageModule.AimingDirection = StorageModule.FacingDirection;
|
||||
}
|
||||
|
||||
private void MoveTowardsPosition(Vector2 position)
|
||||
|
|
|
|||
|
|
@ -172,11 +172,14 @@ public partial class Shooting : EnemyStateBase
|
|||
if (!PlayerDetection.LastKnownPlayerPosition.HasValue) return;
|
||||
|
||||
var direction = GetShootDirection();
|
||||
|
||||
|
||||
|
||||
// Shoot at the player's last known position
|
||||
EquippedWeapon.ShootDirection = direction;
|
||||
//StorageModule.FacingDirection = direction;
|
||||
StorageModule.FacingDirection = direction.SnapToCardinal().Normalized();
|
||||
StorageModule.AimingDirection = StorageModule.FacingDirection;
|
||||
|
||||
EquippedWeapon.Shoot();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue