My first 3D game with Godot 4.4

This commit is contained in:
2025-08-18 18:48:02 -04:00
commit aef6af1eca
89 changed files with 10495 additions and 0 deletions

22
player/bullet_3d.gd Normal file
View File

@@ -0,0 +1,22 @@
extends Area3D
const SPEED = 55.0
const RANGE = 80.0
var travelled_distance = 0.0
func _physics_process(delta: float) -> void:
var distance = SPEED * delta
position += -transform.basis.z * distance
if travelled_distance >= RANGE:
queue_free()
else:
travelled_distance += distance
func _on_body_entered(body: Node3D) -> void:
queue_free()
if body.has_method("take_damage"):
body.take_damage(randf_range(25.0, 50.0))