summaryrefslogtreecommitdiff
path: root/Bullet.cs
diff options
context:
space:
mode:
authoralex <[email protected]>2026-07-21 01:42:31 +0200
committeralex <[email protected]>2026-07-21 01:42:31 +0200
commitddb50b0b66c838bc97e79c826ff5375e15f8f038 (patch)
treea4c08f1571cbeff61f7f94f1f3510494729f30df /Bullet.cs
downloadgodot-testing-ddb50b0b66c838bc97e79c826ff5375e15f8f038.tar.xz
godot-testing-ddb50b0b66c838bc97e79c826ff5375e15f8f038.zip
init
Diffstat (limited to 'Bullet.cs')
-rw-r--r--Bullet.cs16
1 files changed, 16 insertions, 0 deletions
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