mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-10 12:07:56 -06:00
refactor: restructure game logic and state management into separate modules
- Moved game logic from `game.rs` to `game/mod.rs` and `game/state.rs` for better organization. - Updated `App` to utilize the new `Game` struct and its state management. - Refactored error handling - Removed unused audio subsystem references
This commit is contained in:
@@ -98,10 +98,8 @@ impl Pacman {
|
||||
let stopped_tiles = vec![SpriteAtlas::get_tile(atlas, &format!("{moving_prefix}_b.png"))
|
||||
.ok_or_else(|| GameError::Texture(TextureError::AtlasTileNotFound(format!("{moving_prefix}_b.png"))))?];
|
||||
|
||||
textures[direction.as_usize()] =
|
||||
Some(AnimatedTexture::new(moving_tiles, 0.08).map_err(|e| GameError::Texture(TextureError::Animated(e)))?);
|
||||
stopped_textures[direction.as_usize()] =
|
||||
Some(AnimatedTexture::new(stopped_tiles, 0.1).map_err(|e| GameError::Texture(TextureError::Animated(e)))?);
|
||||
textures[direction.as_usize()] = Some(AnimatedTexture::new(moving_tiles, 0.08)?);
|
||||
stopped_textures[direction.as_usize()] = Some(AnimatedTexture::new(stopped_tiles, 0.1)?);
|
||||
}
|
||||
|
||||
Ok(Self {
|
||||
|
||||
Reference in New Issue
Block a user