Repository navigation
feat(booth): send idle and finished players back to the attract screen #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| extends Control | ||
| ## The booth's game-over card. AppRouter lays it over a finished game when the booth player has | ||
| ## used their retries: GAME OVER, the game's score line, a thank-you, and a countdown to the next | ||
| ## player. It takes no input; the router opens the attract route when the countdown ends. | ||
| const Style = preload("res://scenes/main_menu/menu_style.gd") | ||
| var summary: Label | ||
| var countdown: Label | ||
|
|
||
| func _init() -> void: | ||
| name = "NextPlayerCard" | ||
| set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) | ||
| # Stop clicks reaching the game underneath. | ||
| mouse_filter = Control.MOUSE_FILTER_STOP | ||
| theme = Style.theme() | ||
| var dim := ColorRect.new() | ||
| dim.color = Color(0.01, 0.02, 0.04, 0.84) | ||
| dim.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) | ||
| dim.mouse_filter = Control.MOUSE_FILTER_IGNORE | ||
| add_child(dim) | ||
| var center := CenterContainer.new() | ||
| center.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) | ||
| center.mouse_filter = Control.MOUSE_FILTER_IGNORE | ||
| add_child(center) | ||
| var column := VBoxContainer.new() | ||
| column.add_theme_constant_override("separation", 16) | ||
| center.add_child(column) | ||
| var title := Style.label("GAME OVER", 48) | ||
| summary = Style.label("", 24, Style.MINT) | ||
| var thanks := Style.label("Thanks for playing!", 26) | ||
| countdown = Style.label("", 18, Color("afbdc9")) | ||
| for label in [title, summary, thanks, countdown]: | ||
| label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER | ||
| column.add_child(label) | ||
| hide() | ||
|
|
||
| ## Show the card with the game's score line ("" for none) and the seconds left. | ||
| func present(score_line: String, seconds: float) -> void: | ||
| summary.text = score_line | ||
| summary.visible = score_line != "" | ||
| set_seconds(seconds) | ||
| show() | ||
|
|
||
| func set_seconds(seconds: float) -> void: | ||
| countdown.text = "Next player in %d" % ceili(maxf(seconds, 0.0)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| uid://c5a3iwsssrkab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.