Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Keyboard::isPressed(GLFW_KEY_SPACE)){
- if (hop){
- posZ = posZ + jump*((float)cos(-90 * 3.14 / 180.0f)) * 20;
- if (posZ >= gravity){
- hop = false;
- }
- }
- else{
- if (posZ > 0){
- posZ = posZ - jump*((float)cos(-90 * 3.14 / 180.0f)) * 100;
- }
- else{
- hop = true;
- }
- }
- }
- else{
- if (posZ > 0){
- posZ = posZ - jump*((float)cos(-90 * 3.14 / 180.0f)) * 20;
- }
- }
- if (posZ < 0){
- posZ = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement