Skip to content

Commit

Permalink
Display version in the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
wenyuzhao committed Sep 14, 2023
1 parent 873b21a commit 04175d5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use ground::Ground;
use mask::Mask;
use obstacle::Obstacles;
use playdate_rs::graphics::{Font, LCDSolidColor};
use playdate_rs::system::Buttons;
use playdate_rs::system::{Buttons, MenuItem};
use playdate_rs::{app, println, App, PLAYDATE};
use spin::Lazy;

Expand All @@ -42,6 +42,7 @@ pub struct DinoGame {
mask: Mask,
scoreboard: Scoreboard,
state: RefCell<GameState>,
_menu: MenuItem,
}

impl DinoGame {
Expand Down Expand Up @@ -73,6 +74,9 @@ impl App for DinoGame {
mask: Mask::new(),
scoreboard: Scoreboard::new(),
state: RefCell::new(GameState::Ready),
_menu: PLAYDATE
.system
.add_menu_item(format!("Version: {}", env!("CARGO_PKG_VERSION")), || {}),
}
}

Expand Down

0 comments on commit 04175d5

Please sign in to comment.