Skip to content

Commit abd4a59

Browse files
feat(scoring): Add intermission screen displaying match scores (#987)
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.
1 parent df8c6e7 commit abd4a59

File tree

14 files changed

+779
-228
lines changed

14 files changed

+779
-228
lines changed

Cargo.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/game.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ theme:
9292
scale: 1.2
9393
colors:
9494
positive: 3EC761
95+
negative: F52A2A
9596

9697
widgets:
9798
border_radius: 1.5
@@ -254,6 +255,8 @@ core:
254255
round_end_score_time: 3s
255256
# How long after scoring to wait before transitioning out of round
256257
round_end_post_score_linger_time: 3s
258+
winning_score_threshold: 15
259+
rounds_between_intermission: 7
257260

258261
camera:
259262
default_height: 448

assets/locales/en-US/locale.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ resources:
55
- debug-tools.ftl
66

77
- network-game.ftl
8+
- scoring.ftl
89
- settings.ftl
910
- editor.ftl
1011
- player-select.ftl

assets/locales/en-US/scoring.ftl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
press-confirm-to-ready-up = Press confirm to ready-up
2+
press-confirm-to-play-again = Press confirm to play again
3+
ready = Ready
4+
not-ready = Not Ready
5+
ai = AI
6+
won = Winner
7+
tied = Tied
8+
intermission = Intermission
9+
score = Score
10+
11+
match-complete = Match Complete
12+
tied-for-win = Tied For Win

src/core/metadata.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,10 @@ pub struct CoreConfigMeta {
114114
#[serde(default)]
115115
#[serde(with = "humantime_serde")]
116116
pub round_end_post_score_linger_time: Duration,
117+
118+
/// How many rounds must be won to end match
119+
pub winning_score_threshold: u32,
120+
121+
/// How many rounds between intermissions
122+
pub rounds_between_intermission: u32,
117123
}

src/core/player.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn plugin(session: &mut Session) {
3131
}
3232

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

3737
/// Contains the entities of the extra player layers, such as the player face and fin.

0 commit comments

Comments
 (0)