Skip to content

Commit

Permalink
feat(scoring): Add intermission screen displaying match scores (#987)
Browse files Browse the repository at this point in the history
After enough rounds to reach intermission, screen opens shows current
scores. Players can ready up to continue to next round.

Once player has won, this is communicated. Can ready up for another
match, or exit the game (currently only opening pause menu and returning
to main menu. This is todo).

There's a decent amount of polish needed, but this is a decent start.
  • Loading branch information
MaxCWhitehead authored Apr 22, 2024
1 parent df8c6e7 commit abd4a59
Show file tree
Hide file tree
Showing 14 changed files with 779 additions and 228 deletions.
30 changes: 15 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions assets/game.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ theme:
scale: 1.2
colors:
positive: 3EC761
negative: F52A2A

widgets:
border_radius: 1.5
Expand Down Expand Up @@ -254,6 +255,8 @@ core:
round_end_score_time: 3s
# How long after scoring to wait before transitioning out of round
round_end_post_score_linger_time: 3s
winning_score_threshold: 15
rounds_between_intermission: 7

camera:
default_height: 448
Expand Down
1 change: 1 addition & 0 deletions assets/locales/en-US/locale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resources:
- debug-tools.ftl

- network-game.ftl
- scoring.ftl
- settings.ftl
- editor.ftl
- player-select.ftl
Expand Down
12 changes: 12 additions & 0 deletions assets/locales/en-US/scoring.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
press-confirm-to-ready-up = Press confirm to ready-up
press-confirm-to-play-again = Press confirm to play again
ready = Ready
not-ready = Not Ready
ai = AI
won = Winner
tied = Tied
intermission = Intermission
score = Score
match-complete = Match Complete
tied-for-win = Tied For Win
6 changes: 6 additions & 0 deletions src/core/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,10 @@ pub struct CoreConfigMeta {
#[serde(default)]
#[serde(with = "humantime_serde")]
pub round_end_post_score_linger_time: Duration,

/// How many rounds must be won to end match
pub winning_score_threshold: u32,

/// How many rounds between intermissions
pub rounds_between_intermission: u32,
}
2 changes: 1 addition & 1 deletion src/core/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn plugin(session: &mut Session) {
}

/// The player index, for example Player 1, Player 2, and so on.
#[derive(Clone, HasSchema, Deref, DerefMut, Default)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, HasSchema, Deref, DerefMut, Default)]
pub struct PlayerIdx(pub u32);

/// Contains the entities of the extra player layers, such as the player face and fin.
Expand Down
Loading

0 comments on commit abd4a59

Please sign in to comment.