Room Creating: Place Kitchen Furniture (#11)
Co-authored-by: Glaeder <niklas@vousten.dev> Co-authored-by: Fredi <fredrik.konrad@rwth-aachen.de> Reviewed-on: #11 Co-authored-by: Dominic <git@msrd0.de> Co-committed-by: Dominic <git@msrd0.de>
This commit is contained in:
parent
1275b92a5b
commit
33b301a410
54 changed files with 569 additions and 46 deletions
|
@ -1,11 +1,4 @@
|
|||
use crate::{
|
||||
activities::{
|
||||
house::{self, HouseState},
|
||||
Activity
|
||||
},
|
||||
game::ZLayer,
|
||||
State
|
||||
};
|
||||
use crate::{activities::Activity, game::ZLayer, State};
|
||||
use comfy::{
|
||||
draw_circle, draw_rect_outline, draw_sprite, error, info, is_key_down,
|
||||
main_camera_mut, EngineContext, IVec2, KeyCode, Vec2, RED, WHITE
|
||||
|
@ -32,7 +25,7 @@ pub fn draw(state: &crate::State, _engine: &comfy::EngineContext<'_>) {
|
|||
draw_circle(state.ghost.overworld_pos, 0.5, RED, ZLayer::Ghost.into());
|
||||
}
|
||||
|
||||
fn update_move_player(state: &mut State) {
|
||||
fn update_move_player(state: &mut State, ctx: &mut EngineContext<'_>) {
|
||||
let now = Instant::now();
|
||||
|
||||
// Are there any pending position updates? If so, we ignore all user input and execute
|
||||
|
@ -160,18 +153,18 @@ fn update_move_player(state: &mut State) {
|
|||
if current_tile.can_enter_house() {
|
||||
info!("enter house at {tile_pos}");
|
||||
state.activity = Activity::House(tile_pos);
|
||||
state.house_mut(); // gen new house
|
||||
state.house_mut(ctx); // gen new house
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update(state: &mut State, _ctx: &mut EngineContext<'_>) {
|
||||
pub fn update(state: &mut State, ctx: &mut EngineContext<'_>) {
|
||||
let mut camera = main_camera_mut();
|
||||
camera.center = Vec2::ZERO;
|
||||
camera.zoom = 30.0;
|
||||
|
||||
// move player
|
||||
update_move_player(state);
|
||||
update_move_player(state, ctx);
|
||||
|
||||
// generate more chunks if needed
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue