Added pause capability to all levels, added music to Level 5, added a simple chasing AI to the glowing ghosts, and optimized the Main Menu scene

This commit is contained in:
VoidTwo
2021-11-28 20:33:22 -06:00
parent b6b8edce83
commit 4c55683bde
41 changed files with 396 additions and 151 deletions

27
Enemies/Glowing Ghost.gd Normal file
View File

@@ -0,0 +1,27 @@
extends KinematicBody2D
const SPEED: int = 50
var player: KinematicBody2D = null
var velocity: Vector2 = Vector2.ZERO
func _physics_process(_delta: float) -> void:
velocity = Vector2.ZERO
if player:
velocity = position.direction_to(player.position).normalized() * SPEED
velocity = move_and_slide(velocity)
return
func _on_player_detector_area_entered(area: Area2D) -> void:
if area.get_parent().name == 'Player':
player = area.get_parent()
return
func _on_player_detector_area_exited(_area: Area2D):
player = null
return