Fixed signals; removed most extra debug output. Still issues with
shieldbar showing accurate damage, but functionality of main branch restored.
This commit is contained in:
parent
a73fb28552
commit
485f03d702
3 changed files with 8 additions and 3 deletions
6
main.gd
6
main.gd
|
|
@ -10,6 +10,8 @@ var playing = false
|
|||
func _ready():
|
||||
game_over.hide()
|
||||
start_button.show()
|
||||
EventBus.player_died.connect(_on_player_died)
|
||||
EventBus.enemy_died.connect(_on_enemy_died)
|
||||
# spawn_enemies()
|
||||
|
||||
func spawn_enemies():
|
||||
|
|
@ -21,12 +23,14 @@ func spawn_enemies():
|
|||
e.start(pos)
|
||||
EventBus.enemy_died.emit()
|
||||
|
||||
|
||||
|
||||
func _on_enemy_died(value):
|
||||
print_debug("Enemy died!")
|
||||
score += value
|
||||
$CanvasLayer/UI.update_score(score)
|
||||
|
||||
func _on_player_died():
|
||||
print("game over")
|
||||
playing = false
|
||||
get_tree().call_group("enemies", "queue_free")
|
||||
game_over.show()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue