status bar display
This commit is contained in:
@@ -66,6 +66,14 @@ pub struct GameState {
|
||||
/// by [`enter_board`](GameState::enter_board). Front-ends tick this down and
|
||||
/// may block input or show a visual effect while it is `Some(t)` where `t > 0`.
|
||||
pub board_transition: Option<f64>,
|
||||
/// The player's current health. Game-global (not per-board), so it persists
|
||||
/// across board transitions. Players start with `5`. There is no runtime
|
||||
/// mutation path yet — front-ends only display it.
|
||||
pub player_health: u32,
|
||||
/// The number of gems the player has collected. Game-global like
|
||||
/// [`player_health`](GameState::player_health); starts at `0` and is
|
||||
/// display-only for now.
|
||||
pub player_gems: u32,
|
||||
}
|
||||
|
||||
impl GameState {
|
||||
@@ -92,6 +100,8 @@ impl GameState {
|
||||
speech_bubbles: Vec::new(),
|
||||
active_scroll: None,
|
||||
board_transition: None,
|
||||
player_health: 5,
|
||||
player_gems: 0,
|
||||
};
|
||||
state.drain_errors();
|
||||
state
|
||||
|
||||
Reference in New Issue
Block a user