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
1
enemy.gd
1
enemy.gd
|
|
@ -36,6 +36,7 @@ func _process(delta):
|
|||
|
||||
|
||||
func explode():
|
||||
print_debug("Enemy died!")
|
||||
speed = 0
|
||||
$AnimationPlayer.play("explode")
|
||||
set_deferred("monitoring", false)
|
||||
|
|
|
|||
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()
|
||||
|
|
|
|||
4
ui.gd
4
ui.gd
|
|
@ -21,12 +21,12 @@ func _on_shield_changed(max_value: int, old_value: int, new_value: int) -> void:
|
|||
print("Shield Depletion:", old_value, "-", new_value, " = ", shield_depletion)
|
||||
var tween = create_tween()
|
||||
tween.tween_property(shield_bar, "value", new_value - shield_depletion, .20).set_trans(Tween.TRANS_LINEAR)
|
||||
_on_shield_ui()
|
||||
_on_fx_shield_ui()
|
||||
|
||||
|
||||
|
||||
|
||||
func _on_shield_ui():
|
||||
func _on_fx_shield_ui():
|
||||
shader_active = true
|
||||
shield_bar.material.set_shader_parameter("toggle", 1.0)
|
||||
await get_tree().create_timer(1).timeout
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue