prototype

This commit is contained in:
Michael Campbell 2026-01-29 14:23:33 -05:00
commit 5bac9ddd2a
33 changed files with 956 additions and 0 deletions

25
police_car.gd Normal file
View file

@ -0,0 +1,25 @@
class_name PoliceCar
extends CharacterBody3D
@export var dot_curve: Curve
func _physics_process(delta: float) -> void:
%NavAgent.target_position = Player.instance.global_position
var dir := global_position.direction_to(%NavAgent.get_next_path_position())
dir.y = 0
var dot_power := dot_curve.sample(dir.dot(velocity.normalized()))
velocity += dir * 8. * delta * dot_power
velocity = velocity.limit_length(8.)
move_and_slide()
rotation.y = Vector2(velocity.x, -velocity.z).angle()
func hit(_proj: PlayerProjectile):
queue_free()
func _on_hurtbox_body_entered(body: Node3D) -> void:
if body is Player:
body.damage()