gun system + minigun

This commit is contained in:
Michael Campbell 2026-02-19 00:04:31 -05:00
parent 84415d5aca
commit f73f093ae2
13 changed files with 84 additions and 24 deletions

View file

@ -3,6 +3,8 @@ extends CharacterBody3D
@export var dot_curve: Curve
var health := 10.
func _physics_process(delta: float) -> void:
%NavAgent.target_position = Player.instance.global_position
@ -15,8 +17,11 @@ func _physics_process(delta: float) -> void:
rotation.y = Vector2(velocity.x, -velocity.z).angle()
func hit(_proj: PlayerProjectile) -> bool:
queue_free()
func hit(_proj: PlayerProjectile, damage: float) -> bool:
health -= damage
if health <= 0:
queue_free()
return true

View file

@ -6,7 +6,7 @@ func _ready() -> void:
assert(get_parent() is PoliceCar)
parent = get_parent()
func hit(projectile: PlayerProjectile) -> bool:
func hit(projectile: PlayerProjectile, _damage: float) -> bool:
if projectile == null: return false
var angle := projectile.velocity.angle_to(-parent.velocity)