Adds better folder structure, and adds simple dialogue system

This commit is contained in:
2024-10-06 15:57:47 +02:00
parent 2cf9884f9d
commit 0f6f75ea44
31 changed files with 178 additions and 53 deletions

View File

@@ -23,12 +23,17 @@ func _unhandled_input(event: InputEvent) -> void:
$SpawnTimer.paused = false
func _ready() -> void:
$Dialog.start()
func start_game():
$SpawnTimer.start()
change_red_button()
first_time = false
$SpawnTimer.wait_time = spawn_interval
for button in get_tree().get_nodes_in_group("button_group"):
button.enemy_killed.connect(on_enemy_killed)
func _process(delta: float) -> void:
health = minf(health + RECOVERY_RATE * delta ,MAX_HEALTH)
@@ -87,3 +92,7 @@ func _on_spawn_timer_timeout() -> void:
func on_enemy_killed():
player_score+=1
print_debug(player_score)
func _on_dialog_dialogue_over() -> void:
start_game()