From e67479a9bdae4d343f9c217b51df2073c2ea0b50 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 18 Sep 2023 18:06:51 -0700 Subject: [PATCH] TEMP: move jump out --- src/body.rs | 8 -------- src/main.rs | 10 ++++++++++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/body.rs b/src/body.rs index 964eeba..f20a602 100644 --- a/src/body.rs +++ b/src/body.rs @@ -640,14 +640,6 @@ impl crate::instruction::InstructionEmitter for PhysicsState fn next_instruction(&self,time_limit:TIME) -> Option> { //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)); diff --git a/src/main.rs b/src/main.rs index b733d87..1d75792 100644 --- a/src/main.rs +++ b/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 });