update dr.boy

This commit is contained in:
ZennDev1337 2023-09-04 15:07:26 +02:00
parent 7e9d189d98
commit 85dde9ebef
3 changed files with 239 additions and 236 deletions

View file

@ -2,6 +2,7 @@ use crate::*;
pub unsafe fn gameloop() {
arduboy.set_cursor(70, 0);
arduboy.set_text_size(1);
arduboy.print(get_string_addr!(overlay_score));
arduboy.print(p.counter as i16);
match p.live {
@ -80,7 +81,7 @@ pub unsafe fn gameloop() {
if p.live == 0 {
let score = scorebord.check_score(p.counter);
if score > 0 {
scorebord.update_score(p.counter)
scorebord.update_score(p.counter, &eeprom)
}
p.gamemode = GameMode::Losescreen;
}

View file

@ -33,7 +33,7 @@ impl Scoreboard {
_ => 0,
}
}
pub fn update_score(&mut self, score: u16) {
pub fn update_score(&mut self, score: u16, e: &EEPROM) {
let place = self.check_score(score);
match place {
1 => {
@ -50,6 +50,7 @@ impl Scoreboard {
}
_ => (),
}
e.put(self)
}
}
// dynamic ram variables