still working on movement, for some reason some cells do not get set as solid that's why multiple can go on a cell

This commit is contained in:
2026-06-09 03:15:35 -04:00
parent 813ca5f633
commit 7a10f4a9fc
10 changed files with 288 additions and 326 deletions
+11 -2
View File
@@ -7,11 +7,20 @@ public partial class Bucket : Node2D
[Signal]
public delegate void AttackEnteredEventHandler(Attack ATTACK);
public int _minX = -500, _maxX = 500, _movementSign = 1, _movementSpeed = 3;
public Vector2 _startPoisition;
public override void _Ready()
{
base._Ready();
_startPoisition = GlobalPosition;
}
public void Move()
{
Position += new Vector2(_movementSign * _movementSpeed, 0);
if (Position.X >= _maxX || Position.X <= _minX)
GlobalPosition += new Vector2(_movementSign * _movementSpeed, 0);
Vector2 offset = _startPoisition - GlobalPosition;
if (offset.X >= _maxX || offset.X <= _minX)
{
_movementSign *= -1;
}