Adds missing data

This commit is contained in:
Michel 2025-02-03 19:17:20 +01:00
parent e6391d9fdd
commit 53cdcc3433
620 changed files with 47293 additions and 151 deletions

View file

@ -8,6 +8,9 @@ const MOVEMENT_SPEED = 1
@onready var enemyAi: EnemyAI = $BTPlayer
@onready var health: Health = $Health
@onready var origin: Node3D = $"enemies/Vert/Shoot Marker"
@onready var enemyVisual: Node3D = $enemies/Vert
@onready var shootSound: AudioStreamPlayer3D = $"enemies/Vert/Shoot Marker/ShootSound"
@onready var deathSound: AudioStreamPlayer = $DeathSound
const SPEED = 5.0
const JUMP_VELOCITY = 4.5
@ -18,13 +21,19 @@ func _ready() -> void:
health.death.connect(died)
func died() -> void:
deathSound.play()
process_mode = Node.PROCESS_MODE_DISABLED
await deathSound.finished
queue_free()
func updateMovementBlend(delta: float, to: float) -> void:
movementBlend = move_toward(movementBlend, to, delta * 2);
func rotateTo(delta: float, targetDirection: Vector3) -> void:
self.global_basis.z = lerp(self.global_basis.z, targetDirection, delta * 10);
self.global_basis.z = targetDirection;
func _physics_process(delta: float) -> void:
if agent.is_navigation_finished():
@ -50,11 +59,10 @@ func _physics_process(delta: float) -> void:
self.animationtree['parameters/Movement/blend_position'] = movementBlend
func fireWeapon() -> void:
var fireDirection = (Player.Instance.enemyTarget.global_position - origin.global_position).normalized()
fireDirection = fireDirection.rotated(Vector3.UP, randf_range(-.3, .3))
shootSound.play()
DebugDraw3D.draw_arrow(origin.global_position, origin.global_position + Vector3.UP * 1, Color.RED, 0.5, true, 10)
DebugDraw3D.draw_arrow(origin.global_position, origin.global_position + fireDirection * 10, Color.WHITE, 0.5, true, 10)
var fireDirection = (Player.Instance.enemyTarget.global_position - origin.global_position).normalized()
fireDirection = fireDirection.rotated(Vector3.UP, randf_range(-0.1, 0.1))
var query = PhysicsRayQueryParameters3D.create(origin.global_position, origin.global_position + fireDirection * 200)
var result = get_world_3d().direct_space_state.intersect_ray(query)
@ -67,4 +75,4 @@ func fireWeapon() -> void:
if not health:
return
result.collider.health.take_damage(1, Vector2(0,0))
result.collider.health.take_damage(1, Vector2(0,0), self.origin)