diff --git a/examples/combo/Cargo.lock b/examples/combo/Cargo.lock index e623a679..b39df590 100644 --- a/examples/combo/Cargo.lock +++ b/examples/combo/Cargo.lock @@ -85,6 +85,13 @@ dependencies = [ "version_check", ] +[[package]] +name = "amplitude" +version = "0.1.0" +dependencies = [ + "agb", +] + [[package]] name = "asefile" version = "0.3.5" @@ -167,6 +174,7 @@ name = "combo" version = "0.1.0" dependencies = [ "agb", + "amplitude", "hyperspace-roll", "the-hat-chooses-the-wizard", "the-purple-night", diff --git a/examples/combo/Cargo.toml b/examples/combo/Cargo.toml index d27c394e..e9d93b33 100644 --- a/examples/combo/Cargo.toml +++ b/examples/combo/Cargo.toml @@ -10,6 +10,7 @@ agb = { version = "0.14.0", path = "../../agb" } the-purple-night = { path = "../the-purple-night" } the-hat-chooses-the-wizard = { path = "../the-hat-chooses-the-wizard" } hyperspace-roll = { path = "../hyperspace-roll" } +amplitude = { path = "../amplitude" } [profile.dev] diff --git a/examples/combo/gfx/amplitude.png b/examples/combo/gfx/amplitude.png new file mode 100644 index 00000000..2086f1cb Binary files /dev/null and b/examples/combo/gfx/amplitude.png differ diff --git a/examples/combo/gfx/games.aseprite b/examples/combo/gfx/games.aseprite deleted file mode 100644 index 5f2832bd..00000000 Binary files a/examples/combo/gfx/games.aseprite and /dev/null differ diff --git a/examples/combo/gfx/hyperspace.png b/examples/combo/gfx/hyperspace.png index 59aae544..b73df24b 100644 Binary files a/examples/combo/gfx/hyperspace.png and b/examples/combo/gfx/hyperspace.png differ diff --git a/examples/combo/src/lib.rs b/examples/combo/src/lib.rs index 0092078a..42c9180c 100644 --- a/examples/combo/src/lib.rs +++ b/examples/combo/src/lib.rs @@ -21,6 +21,7 @@ pub enum Game { TheHatChoosesTheWizard, ThePurpleNight, HyperspaceRoll, + Amplitude, } impl Game { @@ -29,6 +30,7 @@ impl Game { Game::TheHatChoosesTheWizard => the_hat_chooses_the_wizard::main(gba), Game::ThePurpleNight => the_purple_night::main(gba), Game::HyperspaceRoll => hyperspace_roll::main(gba), + Game::Amplitude => amplitude::main(gba), } } @@ -37,6 +39,7 @@ impl Game { 0 => Game::TheHatChoosesTheWizard, 1 => Game::ThePurpleNight, 2 => Game::HyperspaceRoll, + 3 => Game::Amplitude, _ => unreachable!("game out of index in an unreachable manner"), } } @@ -46,7 +49,8 @@ include_background_gfx!( games, "121105", hat => "gfx/hat.png", purple => "gfx/purple.png", - hyperspace => "gfx/hyperspace.png" + hyperspace => "gfx/hyperspace.png", + amplitude => "gfx/amplitude.png" ); fn get_game(gba: &mut agb::Gba) -> Game { @@ -58,13 +62,15 @@ fn get_game(gba: &mut agb::Gba) -> Game { let hat = TileSet::new(games::hat.tiles, TileFormat::FourBpp); let purple = TileSet::new(games::purple.tiles, TileFormat::FourBpp); let hyperspace = TileSet::new(games::hyperspace.tiles, TileFormat::FourBpp); + let amplitude = TileSet::new(games::amplitude.tiles, TileFormat::FourBpp); - let tiles = [hat, purple, hyperspace]; + let tiles = [hat, purple, hyperspace, amplitude]; let palette_assignments = &[ games::hat.palette_assignments, games::purple.palette_assignments, games::hyperspace.palette_assignments, + games::amplitude.palette_assignments, ]; vram.set_background_palettes(games::PALETTES); @@ -79,7 +85,7 @@ fn get_game(gba: &mut agb::Gba) -> Game { let y = pos.y.rem_euclid(20); let x = pos.x.rem_euclid(30); - let game = (pos.x).rem_euclid(90) as usize / 30; + let game = (pos.x).rem_euclid(tiles.len() as i32 * 30) as usize / 30; let tile_id = (y * 30 + x) as usize; ( &tiles[game],