123456789101112131415161718192021222324252627282930 |
- class_name Game
- extends Node
- signal start_new_game
- enum State {
- BOOTING,
- SET_UP,
- IN_PROGRESS,
- LOST
- }
- var _current_state = State.BOOTING
- func _ready():
- _current_state = State.IN_PROGRESS
- func _unhandled_input(event: InputEvent) -> void:
- if event.is_action_released("ui_accept"):
- if _current_state == State.LOST:
- _current_state = State.IN_PROGRESS
- emit_signal("start_new_game")
- func _on_game_lost():
- _current_state = State.LOST
|