controller input

This commit is contained in:
2019-07-31 19:13:59 +02:00
parent 7dff6354b9
commit 7fe3d34d79
4 changed files with 116 additions and 6 deletions

View File

@@ -33,6 +33,8 @@ impl TestGame<'_> {
}
fn update(self: &mut Self, renderer: &mut VulkanRenderer) {
self.input.frame_start();
let new_time = renderer.game_data.start_time.elapsed().unwrap().as_millis() as f32 / 1000.0;
let frame_time = new_time - renderer.game_data.push_constants.time;
renderer.game_data.push_constants.time = new_time;
@@ -51,6 +53,7 @@ impl TestGame<'_> {
}
if self.input.button_just_pressed("test") {
println!("test");
self.cubes.push(renderer.add_game_object(GameObject::new(self.cube_mesh.unwrap())));
}