Merge pull request #176 from gwilymk/fix-clippy-lints-in-hat-chooses-wizard

Fix clippy lints for hat-chooses-wizard
This commit is contained in:
Gwilym Kuiper 2022-03-05 18:37:33 +00:00 committed by GitHub
commit 60977b7d2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View file

@ -174,14 +174,14 @@ mod tiled_export {
pub const fn get_level() -> Level {{ pub const fn get_level() -> Level {{
Level {{ Level {{
background: &TILEMAP, background: TILEMAP,
foreground: &BACKGROUND, foreground: BACKGROUND,
dimensions: Vector2D {{x: WIDTH, y: HEIGHT}}, dimensions: Vector2D {{x: WIDTH, y: HEIGHT}},
collision: &crate::map_tiles::tilemap::TILE_DATA, collision: crate::map_tiles::tilemap::TILE_DATA,
enemy_stops: &ENEMY_STOPS, enemy_stops: ENEMY_STOPS,
slimes: &SLIMES, slimes: SLIMES,
snails: &SNAILS, snails: SNAILS,
start_pos: START_POS, start_pos: START_POS,
}} }}
}} }}

View file

@ -19,7 +19,7 @@ pub struct Level {
} }
mod object_tiles { mod object_tiles {
pub const WIZARD_TILE_START: u16 = 0 * 4; pub const WIZARD_TILE_START: u16 = 0;
pub const WIZARD_JUMP: u16 = 4 * 4; pub const WIZARD_JUMP: u16 = 4 * 4;
pub const WIZARD_FALL_START: u16 = 5 * 4; pub const WIZARD_FALL_START: u16 = 5 * 4;
@ -504,7 +504,7 @@ impl<'a> Player<'a> {
let hat_base_tile = match self.num_recalls { let hat_base_tile = match self.num_recalls {
0 => object_tiles::HAT_TILE_START, 0 => object_tiles::HAT_TILE_START,
1 => object_tiles::HAT_TILE_START_SECOND, 1 => object_tiles::HAT_TILE_START_SECOND,
2 | _ => object_tiles::HAT_TILE_START_THIRD, _ => object_tiles::HAT_TILE_START_THIRD,
}; };
match self.facing { match self.facing {
@ -540,7 +540,7 @@ impl<'a> Player<'a> {
let hat_sprite_divider = match self.num_recalls { let hat_sprite_divider = match self.num_recalls {
0 => 1, 0 => 1,
1 => 2, 1 => 2,
2 | _ => 4, _ => 4,
}; };
let hat_sprite_offset = timer / hat_sprite_divider % 10; let hat_sprite_offset = timer / hat_sprite_divider % 10;