From 4f5c9afed3c70d9a32855fe99d268d54f7619b8f Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 8 Sep 2023 20:13:30 -0700 Subject: [PATCH] comments on implementing game mechanics --- src/body.rs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/body.rs b/src/body.rs index 7c79ea5..b60c221 100644 --- a/src/body.rs +++ b/src/body.rs @@ -5,6 +5,12 @@ pub enum PhysicsInstruction { CollisionEnd(RelativeCollision), StrafeTick, Jump, + // Water, + // Spawn( + // Option, + // bool,//true = Trigger; false = teleport + // bool,//true = Force + // ) } pub struct Body { @@ -216,15 +222,48 @@ impl PhysicsState { fn next_strafe_instruction(&self) -> Option> { return Some(TimedInstruction{ time:(self.time*self.strafe_tick_num/self.strafe_tick_den+1)*self.strafe_tick_den/self.strafe_tick_num, + //only poll the physics if there is a before and after mouse event instruction:PhysicsInstruction::StrafeTick }); } + //state mutated on collision: + //Accelerator + //stair step-up + + //state mutated on instruction + //change fly acceleration (fly_sustain) + //change fly velocity + + //generic event emmiters + //PlatformStandTime + //walk/swim/air/ladder sounds + //VState? + + //falling under the map + // fn next_respawn_instruction(&self) -> Option> { + // if self.body.position Option> { + // return Some(TimedInstruction{ + // time:(self.time*self.strafe_tick_num/self.strafe_tick_den+1)*self.strafe_tick_den/self.strafe_tick_num, + // //only poll the physics if there is a before and after mouse event + // instruction:PhysicsInstruction::Water + // }); + // } + fn next_walk_instruction(&self) -> Option> { //check if you are accelerating towards a walk target velocity and create an instruction return None; } fn predict_collision_end(&self,model:&Model) -> Option> { + //must treat cancollide false objects differently: you may not exit through the same face you entered. None } fn predict_collision_start(&self,model:&Model) -> Option> {