enter house (#10)
Reviewed-on: #10 Co-authored-by: luckyturtledev <git@lukas1818.de> Co-committed-by: luckyturtledev <git@lukas1818.de>
This commit is contained in:
parent
1c897d6712
commit
bb37f613ad
5 changed files with 52 additions and 12 deletions
|
@ -11,13 +11,16 @@ pub struct HouseState {
|
|||
}
|
||||
|
||||
pub fn draw(state: &crate::State, _engine: &comfy::EngineContext<'_>) {
|
||||
//Draw Grid
|
||||
state.house.grid.draw();
|
||||
if let Some(house) = state.house() {
|
||||
//Draw Grid
|
||||
house.grid.draw();
|
||||
|
||||
//Draw Player
|
||||
state.house.player.draw();
|
||||
//Draw Player
|
||||
house.player.draw();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update(state: &mut crate::State, _engine: &mut comfy::EngineContext<'_>) {
|
||||
state.house.player.update(&state.house.grid);
|
||||
let house = state.house_mut();
|
||||
house.player.update(&house.grid);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue