Room Creating: Place Kitchen Furniture (#11)
Some checks failed
Rust / rustfmt (push) Successful in 24s
Rust / clippy (push) Failing after 2m27s
Rust / build (push) Successful in 3m8s

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:
Dominic 2024-07-07 11:54:42 +00:00 committed by msrd0
parent 1275b92a5b
commit 33b301a410
54 changed files with 569 additions and 46 deletions

View file

@ -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
{