made bullet with a camera on the end. other tweaks

This commit is contained in:
derek
2024-11-26 17:07:36 -06:00
parent 86a05335e7
commit 86b084f694
17 changed files with 484 additions and 158 deletions

View File

@@ -20,10 +20,11 @@ var rot_amount : float
# Called when the node enters the scene tree for the first time.
func _ready():
SignalBus.enemy_killed.connect(enemy_in_room_killed)
for i in self.get_children():
if i.is_in_group("enemy"):
enemies.append(i)
i.last_enemy_dead.connect(last_enemy_dead)
if i.is_in_group("door"):
doors.append(i)
if i.is_in_group("room_check"):
@@ -66,13 +67,19 @@ func _process(delta):
i.loot_amount = 20 #assign loot to the last enemy drop from this section
i.last_enemy = true
func last_enemy_dead():
if room_lockdown:
room_lockdown = false
func enemy_in_room_killed():
var enemy_count = 0
for i in self.get_children():
if i.is_in_group("enemy") and i.health > 0:
enemy_count += 1
for i in doors:
if !i.door_open:
i.open()
if enemy_count <= 0:
if room_lockdown:
room_lockdown = false
for i in doors:
if !i.door_open:
i.open()
func room_entered():
if room_lockdown: