7-11-25 7:00pm

This commit is contained in:
2025-07-11 19:00:09 -04:00
parent 9057a21613
commit 1d976cf322
75 changed files with 1362 additions and 521 deletions

40
Gameplay/Cue.cs Normal file
View File

@@ -0,0 +1,40 @@
using Godot;
using System;
public partial class Cue : Sprite2D
{
[Signal]
public delegate void ShootEventHandler(Vector2 impulse);
public float _power = 0.0f;
public int _powerDirection = 1;
public override void _Process(double delta)
{
Vector2 mousePosition = GetViewport().GetMousePosition();
LookAt(mousePosition);
if (Input.IsActionPressed("left_click"))
{
_power += 0.1f * _powerDirection;
if (_power >= ((Main)GetParent())._maxPower)
{
_powerDirection = -1;
}
else if (_power <= 0)
{
_powerDirection = 1;
}
}
else
{
if (_power > 0f)
{
_powerDirection = 1;
Vector2 direction = mousePosition - Position;
EmitSignal(SignalName.Shoot, _power * direction);
_power = 0;
}
}
}
}