updating movement and added a bucket, still some clean up to do on movement. TODO: if enemy becomes stuck, reclculate path.

This commit is contained in:
2026-06-05 03:48:07 -04:00
parent 0cbc6cbfc7
commit 12b565715a
19 changed files with 360 additions and 46 deletions
+27
View File
@@ -0,0 +1,27 @@
using Godot;
using System;
public partial class Bucket : Node2D
{
[Signal]
public delegate void AttackEnteredEventHandler(Attack ATTACK);
public int _minX = -500, _maxX = 500, _movementSign = 1, _movementSpeed = 3;
public void Move()
{
Position += new Vector2(_movementSign * _movementSpeed, 0);
if (Position.X >= _maxX || Position.X <= _minX)
{
_movementSign *= -1;
}
}
public void OnBodyEntered(Node2D BODY)
{
if (BODY is Attack attack)
{
EmitSignal(SignalName.AttackEntered, attack);
attack.EnteredBucket();
}
}
}