Initial commit

This commit is contained in:
2026-01-17 18:33:45 -06:00
commit 673bdc0396
45 changed files with 856 additions and 0 deletions

34
Abilities/Sword/Sword.cs Normal file
View File

@@ -0,0 +1,34 @@
using Godot;
using System;
public partial class Sword : MeleeBase
{
[Export] public float SweepArcDegrees { get; set; } = 90f;
[Export] public float Lifetime { get; set; } = 0.25f;
float _elapsedTime = 0f;
float _startRotation, _endRotation;
public override void _Ready()
{
base._Ready();
_startRotation = Rotation + Mathf.DegToRad(-SweepArcDegrees * 0.5f);
_endRotation = Rotation + Mathf.DegToRad(SweepArcDegrees * 0.5f);
Rotation = _startRotation;
}
public override void _PhysicsProcess(double delta)
{
_elapsedTime += (float)delta;
var t = _elapsedTime / Lifetime;
Rotation = Mathf.Lerp(_startRotation, _endRotation, t);
if (_elapsedTime >= Lifetime)
{
QueueFree();
}
}
}