Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. if (Keyboard::isPressed(GLFW_KEY_SPACE)){
  2.         if (hop){
  3.             posZ = posZ + jump*((float)cos(-90 * 3.14 / 180.0f)) * 20;
  4.             if (posZ >= gravity){
  5.                 hop = false;
  6.             }
  7.         }
  8.         else{
  9.             if (posZ > 0){
  10.                 posZ = posZ - jump*((float)cos(-90 * 3.14 / 180.0f)) * 100;
  11.             }
  12.             else{
  13.                 hop = true;
  14.             }
  15.         }
  16.     }
  17.     else{
  18.         if (posZ > 0){
  19.         posZ = posZ - jump*((float)cos(-90 * 3.14 / 180.0f)) * 20;
  20.         }
  21.     }
  22.     if (posZ < 0){
  23.         posZ = 0;
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement