stop skipping over time

This commit is contained in:
Quaternions 2023-09-18 23:57:42 -07:00
parent 17e71d884f
commit 4951d1513d

View File

@ -638,6 +638,9 @@ impl strafe_client::framework::Example for Skybox {
let time=self.start_time.elapsed().as_nanos() as i64; let time=self.start_time.elapsed().as_nanos() as i64;
self.physics.run(time);
//ALL OF THIS IS TOTALLY WRONG!!!
let walk_target_velocity=self.physics.walkspeed*control_dir; let walk_target_velocity=self.physics.walkspeed*control_dir;
//autohop (already pressing spacebar; the signal to begin trying to jump is different) //autohop (already pressing spacebar; the signal to begin trying to jump is different)
if self.physics.grounded&&walk_target_velocity!=self.physics.walk.target_velocity { if self.physics.grounded&&walk_target_velocity!=self.physics.walk.target_velocity {
@ -654,10 +657,8 @@ impl strafe_client::framework::Example for Skybox {
instruction:strafe_client::body::PhysicsInstruction::SetControlDir(control_dir) instruction:strafe_client::body::PhysicsInstruction::SetControlDir(control_dir)
}); });
} }
self.physics.jump_trying=self.camera.controls&CONTROL_JUMP!=0;
self.physics.run(time);
//TOTALLY WRONG!!! self.physics.jump_trying=self.camera.controls&CONTROL_JUMP!=0;
//autohop (already pressing spacebar; the signal to begin trying to jump is different) //autohop (already pressing spacebar; the signal to begin trying to jump is different)
if self.physics.grounded&&self.physics.jump_trying { if self.physics.grounded&&self.physics.jump_trying {
//scroll will be implemented with InputInstruction::Jump(true) but it blocks setting self.jump_trying=true //scroll will be implemented with InputInstruction::Jump(true) but it blocks setting self.jump_trying=true