TEMP: move jump out
This commit is contained in:
parent
ad7abbdf1c
commit
e67479a9bd
@ -640,14 +640,6 @@ impl crate::instruction::InstructionEmitter<PhysicsInstruction> for PhysicsState
|
||||
fn next_instruction(&self,time_limit:TIME) -> Option<TimedInstruction<PhysicsInstruction>> {
|
||||
//JUST POLLING!!! NO MUTATION
|
||||
let mut collector = crate::instruction::InstructionCollector::new(time_limit);
|
||||
//autohop (already pressing spacebar; the signal to begin trying to jump is different)
|
||||
if self.grounded&&self.jump_trying {
|
||||
//scroll will be implemented with InputInstruction::Jump(true) but it blocks setting self.jump_trying=true
|
||||
collector.collect(Some(TimedInstruction{
|
||||
time:self.time,
|
||||
instruction:PhysicsInstruction::Jump
|
||||
}));
|
||||
}
|
||||
//check for collision stop instructions with curent contacts
|
||||
for collision_data in self.contacts.iter() {
|
||||
collector.collect(self.predict_collision_end(self.time,time_limit,collision_data));
|
||||
|
10
src/main.rs
10
src/main.rs
@ -641,6 +641,16 @@ impl strafe_client::framework::Example for Skybox {
|
||||
self.physics.jump_trying=self.camera.controls&CONTROL_JUMP!=0;
|
||||
self.physics.run(time);
|
||||
|
||||
//TOTALLY WRONG!!!
|
||||
//autohop (already pressing spacebar; the signal to begin trying to jump is different)
|
||||
if self.physics.grounded&&self.physics.jump_trying {
|
||||
//scroll will be implemented with InputInstruction::Jump(true) but it blocks setting self.jump_trying=true
|
||||
strafe_client::instruction::InstructionConsumer::process_instruction(&mut self.physics, strafe_client::instruction::TimedInstruction{
|
||||
time:time,//this is in the past when there is no instructions!
|
||||
instruction:strafe_client::body::PhysicsInstruction::Jump
|
||||
});
|
||||
}
|
||||
|
||||
let mut encoder =
|
||||
device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None });
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user