Changeset 11543 for code/branches
- Timestamp:
- Nov 6, 2017, 4:18:11 PM (7 years ago)
- Location:
- code/branches/FlappyOrx_HS17
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FlappyOrx_HS17/data/levels/templates/spaceshipFlappyOrx.oxt
r11529 r11543 86 86 <CameraPosition position="0,20, 90" drag=true mouselook=true /> 87 87 <CameraPosition position="0,30,120" drag=true mouselook=true /> --> 88 <CameraPosition position="0,300,-100" direction="0, -1, 0" drag=false mouselook=true />88 <CameraPosition position="0,300,-100" direction="0, -1, 0" drag=false absolute=true mouselook=true /> 89 89 </camerapositions> 90 90 </FlappyOrxShip> -
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.cc
r11537 r11543 69 69 { 70 70 if(getHealth()<0){ 71 getGame()->costLife();72 73 death();71 setHealth(1); 72 getGame()->death(); 73 death(); 74 74 } 75 75 Vector3 pos = getPosition(); … … 87 87 pos += Vector3(speed + velocity.x, 0, velocity.y) * dt; 88 88 89 if(pos.z > 150){ 90 pos.z=0; 91 velocity.y = 0; 92 } 93 94 // restart if game ended 95 if (getGame()) 96 if (getGame()->bEndGame) 97 { 98 getGame()->start(); 99 return; 100 } 101 89 102 90 103 91 // Camera … … 105 93 if (camera != nullptr) 106 94 { 107 camera->setPosition(Vector3(-pos.z, -pos.y, 0)); 108 camera->setOrientation(Vector3::UNIT_Z, Degree(90)); 95 //camera->setPosition(Vector3(-pos.z, -pos.y, 0)); 96 camera->setPosition(pos.x,-100,0); 97 camera->setOrientation(Vector3::UNIT_Z, Degree(0)); 98 109 99 } 110 100 111 101 112 102 setPosition(pos); 113 setOrientation(Vector3::UNIT_Y, Degree(270)); 103 setOrientation(Vector3::UNIT_Y, Degree(270-velocity.y/10)); 104 105 if(pos.z > 150){ 106 getGame()->death(); 107 death(); 108 } 114 109 115 110 } … … 154 149 Vector3 pos = getPosition(); 155 150 pos.x = 0; 151 pos.z = 0; 152 pos.y = 0; 153 velocity.y = 0; 156 154 setPosition(pos); 155 usleep(1000u); 157 156 } 158 157 }
Note: See TracChangeset
for help on using the changeset viewer.