2023-11-08 06:52:20 +01:00
|
|
|
use crate::level::Level;
|
|
|
|
use crate::player::Player;
|
|
|
|
|
|
|
|
pub struct Game {
|
|
|
|
pub player: Player,
|
|
|
|
pub levels: [Level; 25]
|
2023-11-11 18:55:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Game {
|
|
|
|
pub fn move_player(&mut self, dx: i8, dy: i8) {
|
|
|
|
// check if move is allowed first
|
|
|
|
self.player.change_position(dx, dy);
|
|
|
|
}
|
2023-11-08 06:52:20 +01:00
|
|
|
}
|