Skip to content

Commit

Permalink
Order map according to the image
Browse files Browse the repository at this point in the history
  • Loading branch information
cnmorales committed Nov 28, 2023
1 parent e299761 commit b0bb6aa
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/game/enemy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ use super::{
lazy_static! {
static ref SPRITE_ORIENTATION_ANIMATION_INDEX_MAP: HashMap<SpriteOrientation, [usize; 2]> = {
let mut m = HashMap::new();
m.insert(SpriteOrientation::Up, [4,11]);
m.insert(SpriteOrientation::Down, [0,1]); // TODO update all indexes
m.insert(SpriteOrientation::Left, [12,13]);
m.insert(SpriteOrientation::Right, [8,9]);
m.insert(SpriteOrientation::UpLeft, [20,21]);
m.insert(SpriteOrientation::UpRight, [16,17]);
m.insert(SpriteOrientation::DownLeft, [28,29]);
m.insert(SpriteOrientation::DownRight, [24,25]);
m.insert(SpriteOrientation::Left, [4,11]);
m.insert(SpriteOrientation::UpLeft, [36,43]); //4+32*fila, 11+32*fila
m.insert(SpriteOrientation::Up, [68,75]);
m.insert(SpriteOrientation::UpRight, [100,107]);
m.insert(SpriteOrientation::Right, [132,139]);
m.insert(SpriteOrientation::DownRight, [164,171]);
m.insert(SpriteOrientation::Down, [196,203]); // TODO update all indexes
m.insert(SpriteOrientation::DownLeft, [228,235]);
m
};
}
Expand Down Expand Up @@ -123,7 +123,7 @@ fn spawn_enemies(
speed: Speed(2.),
animation_indices: AnimationIndices::new(4, 11),
animation_timer: AnimationTimer::from_seconds(0.2),
sprite_orientation: SpriteOrientation::Down, // TODO: Randomize
sprite_orientation: SpriteOrientation::Left,
sprite: SpriteSheetBundle {
sprite: TextureAtlasSprite::new(4),
texture_atlas: texture_atlas_handle.clone(),
Expand Down

0 comments on commit b0bb6aa

Please sign in to comment.