Skip to content

Commit 8bd5211

Browse files
committed
pallette switching
1 parent 73536b4 commit 8bd5211

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/game/game_state.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use super::{
1818
use crate::game::ability_cards::AbilityCardStack;
1919
use crate::game::music::SONGS;
2020
use crate::kitty_ss;
21-
use crate::spritesheet;
21+
use crate::spritesheet::{self, KITTY_SPRITESHEET_PALLETES};
2222

2323
pub struct GameState<'a> {
2424
pub players: RefCell<[OptionallyEnabledPlayer; 4]>,
@@ -143,9 +143,12 @@ impl GameState<'static> {
143143

144144
let game_state: &mut GameState = self;
145145

146-
const LEVELS_PER_SONG: usize = 5;
146+
const LEVELS_PER_MOOD: usize = 5;
147147
let new_song_idx =
148-
1 + ((game_state.difficulty_level as usize - 1) / LEVELS_PER_SONG) % (SONGS.len() - 1);
148+
1 + ((game_state.difficulty_level as usize - 1) / LEVELS_PER_MOOD) % (SONGS.len() - 1);
149+
150+
let new_pallete_idx = ((game_state.difficulty_level as usize - 1) / LEVELS_PER_MOOD) % KITTY_SPRITESHEET_PALLETES.len();
151+
game_state.pallette_idx = new_pallete_idx;
149152

150153
if new_song_idx != game_state.song_idx {
151154
game_state.song_timer = 0;

0 commit comments

Comments
 (0)