Fix spelling errors in hyperspace-roll

This commit is contained in:
Gwilym Kuiper 2022-11-17 21:22:14 +00:00
parent 6eeb1d3203
commit f6b5bb69b0
3 changed files with 16 additions and 13 deletions

View file

@ -280,12 +280,12 @@ pub(crate) fn customise_screen(
} }
} }
CustomiseState::Upgrade => { CustomiseState::Upgrade => {
let old_updade = cursor.upgrade; let old_upgrade = cursor.upgrade;
cursor.upgrade = (cursor.upgrade as isize + ud as isize) cursor.upgrade = (cursor.upgrade as isize + ud as isize)
.rem_euclid(upgrades.len() as isize) as usize; .rem_euclid(upgrades.len() as isize) as usize;
if (upgrades[cursor.upgrade] as u32) < 17 { if (upgrades[cursor.upgrade] as u32) < 17 {
if cursor.upgrade != old_updade { if cursor.upgrade != old_upgrade {
load_description( load_description(
upgrades[cursor.upgrade] as usize, upgrades[cursor.upgrade] as usize,
descriptions_map, descriptions_map,

View file

@ -37,8 +37,8 @@ impl FaceSprites {
const S_MALFUNCTION: &Sprite = SPRITES.tags().get("malfunction").sprite(0); const S_MALFUNCTION: &Sprite = SPRITES.tags().get("malfunction").sprite(0);
const S_HEAL: &Sprite = SPRITES.tags().get("player_heal").sprite(0); const S_HEAL: &Sprite = SPRITES.tags().get("player_heal").sprite(0);
const S_BYPASS: &Sprite = SPRITES.tags().get("shield bypass").sprite(0); const S_BYPASS: &Sprite = SPRITES.tags().get("shield bypass").sprite(0);
const S_DOUBLESHOT: &Sprite = SPRITES.tags().get("double shoot").sprite(0); const S_DOUBLE_SHOT: &Sprite = SPRITES.tags().get("double shoot").sprite(0);
const S_TRIPLESHOT: &Sprite = SPRITES.tags().get("triple shoot").sprite(0); const S_TRIPLE_SHOT: &Sprite = SPRITES.tags().get("triple shoot").sprite(0);
const S_BLANK: &Sprite = SPRITES.tags().get("blank").sprite(0); const S_BLANK: &Sprite = SPRITES.tags().get("blank").sprite(0);
const S_DISRUPT: &Sprite = SPRITES.tags().get("disruption").sprite(0); const S_DISRUPT: &Sprite = SPRITES.tags().get("disruption").sprite(0);
const S_MALFUNCTION_SHOOT: &Sprite = SPRITES.tags().get("malfunction shot").sprite(0); const S_MALFUNCTION_SHOOT: &Sprite = SPRITES.tags().get("malfunction shot").sprite(0);
@ -57,8 +57,8 @@ impl FaceSprites {
S_MALFUNCTION, S_MALFUNCTION,
S_HEAL, S_HEAL,
S_BYPASS, S_BYPASS,
S_DOUBLESHOT, S_DOUBLE_SHOT,
S_TRIPLESHOT, S_TRIPLE_SHOT,
S_BLANK, S_BLANK,
S_DISRUPT, S_DISRUPT,
S_MALFUNCTION_SHOOT, S_MALFUNCTION_SHOOT,

View file

@ -1,8 +1,8 @@
use agb::Gba;
use agb::save::Error; use agb::save::Error;
use agb::sync::Static; use agb::sync::Static;
use agb::Gba;
static HIGHSCORE: Static<u32> = Static::new(0); static HIGH_SCORE: Static<u32> = Static::new(0);
pub fn init_save(gba: &mut Gba) -> Result<(), Error> { pub fn init_save(gba: &mut Gba) -> Result<(), Error> {
gba.save.init_sram(); gba.save.init_sram();
@ -22,9 +22,9 @@ pub fn init_save(gba: &mut Gba) -> Result<(), Error> {
let high_score = u32::from_le_bytes(buffer); let high_score = u32::from_le_bytes(buffer);
if high_score > 100 { if high_score > 100 {
HIGHSCORE.write(0) HIGH_SCORE.write(0)
} else { } else {
HIGHSCORE.write(high_score) HIGH_SCORE.write(high_score)
} }
} }
@ -32,11 +32,14 @@ pub fn init_save(gba: &mut Gba) -> Result<(), Error> {
} }
pub fn load_high_score() -> u32 { pub fn load_high_score() -> u32 {
HIGHSCORE.read() HIGH_SCORE.read()
} }
pub fn save_high_score(gba: &mut Gba, score: u32) -> Result<(), Error> { pub fn save_high_score(gba: &mut Gba, score: u32) -> Result<(), Error> {
gba.save.access()?.prepare_write(1..5)?.write(1, &score.to_le_bytes())?; gba.save
HIGHSCORE.write(score); .access()?
.prepare_write(1..5)?
.write(1, &score.to_le_bytes())?;
HIGH_SCORE.write(score);
Ok(()) Ok(())
} }