Hi,
I am writing an FPS game in C++ using OpenGL. I am trying to write the crouch system but I want to make the crouch more smooth. At the moment you press the crouch key the character immediatly moves down. Here is the code:
Crouch Down:
entity[0].crouching = true;
entity[0].centre_height = PLAYER_HEIGHT / 5.0;
entity[0].height = PLAYER_HEIGHT / 2.5;
entity[0].gun_position.x = 0.0;
entity[0].gun_position.y = entity[0].height - 1.0;
entity[0].gun_position.z = 0.0;
Stand back up again:
entity[0].crouching = false;
entity[0].centre_height = PLAYER_HEIGHT / 2.0;
entity[0].height = PLAYER_HEIGHT;
entity[0].gun_position.x = 0.0;
entity[0].gun_position.y = entity[0].height - 1.0;
entity[0].gun_position.z = 0.0;
How can I make the crouch more gradual?
James