- Timestamp:
- Nov 6, 2017, 12:52:38 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.cc
r11521 r11529 73 73 } 74 74 Vector3 pos = getPosition(); 75 velocity.y += gravity; 75 76 getGame()->updatePlayerPos(pos.x); 77 78 79 velocity.y += gravity*dt; 76 80 if(isFlapping){ 77 81 isFlapping = false; 78 velocity.y = -UpwardThrust; 82 if(pos.z > -150) 83 velocity.y = -UpwardThrust; 79 84 } 80 85 81 86 pos += Vector3(speed + velocity.x, 0, velocity.y) * dt; 82 87 83 if(pos.z < -150 || pos.z> 150){88 if(pos.z > 150){ 84 89 pos.z=0; 85 90 velocity.y = 0; … … 94 99 } 95 100 101 96 102 // Camera 97 103 Camera* camera = this->getCamera(); … … 102 108 } 103 109 110 104 111 setPosition(pos); 105 112 setOrientation(Vector3::UNIT_Y, Degree(270));
Note: See TracChangeset
for help on using the changeset viewer.