From ddb50b0b66c838bc97e79c826ff5375e15f8f038 Mon Sep 17 00:00:00 2001 From: alex Date: Tue, 21 Jul 2026 01:42:31 +0200 Subject: init --- Bullet.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Bullet.cs (limited to 'Bullet.cs') diff --git a/Bullet.cs b/Bullet.cs new file mode 100644 index 0000000..aeefd94 --- /dev/null +++ b/Bullet.cs @@ -0,0 +1,16 @@ +using Godot; + +public partial class Bullet : Area2D +{ + [Export] public float Speed { get; set; } = 600.0f; + + // The player script will set this direction when the bullet spawns + public Vector2 Direction { get; set; } = Vector2.Zero; + + public override void _PhysicsProcess(double delta) + { + // Move the bullet over time. + // We multiply by delta to ensure movement is framerate-independent. + Position += Direction * Speed * (float)delta; + } +} \ No newline at end of file -- cgit v1.2.3