input fixes!

This commit is contained in:
2021-10-14 19:22:23 +02:00
parent 35f3d0e4a8
commit 5365097f3b
3 changed files with 24 additions and 9 deletions

View File

@@ -54,9 +54,11 @@ impl Game for TestGame {
let objs = &mut self.game_objects;
let components = &mut self.components;
components.iter_mut().for_each(|component| {
component.update(frame_time, &input, renderer, objs);
});
if !self.paused {
components.iter_mut().for_each(|component| {
component.update(frame_time, &input, renderer, objs);
});
}
// User interaction
if self.input.button_just_released("quit") {
@@ -123,7 +125,7 @@ impl TestGame {
pub fn new(toml_path: &str, log_config: LogConfig) -> TestGame {
TestGame {
input: InputState::new(toml_path, log_config),
player: Player::new(),
player: Player::new(3., 30.),
game_objects: vec![],
text_objects: vec![],
log_config,