Changeset 10032 for code/branches/pickupsFS14/src/modules/jump/Jump.cc
- Timestamp:
- Apr 11, 2014, 12:07:05 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickupsFS14/src/modules/jump/Jump.cc
r10022 r10032 60 60 { 61 61 RegisterObject(Jump); 62 platformList.clear(); 63 yScreenPosition = 0; 64 screenShiftSinceLastUpdate = 0; 65 62 66 //this->numberOfBots_ = 0; //sets number of default bots temporarly to 0 63 67 //this->center_ = 0; 64 // init();65 68 //this->setHUDTemplate("JumpHUD"); 66 69 67 } 68 69 void Jump::init() 70 { 71 /*bEndGame = false; 72 lives = 3; 73 level = 1; 74 point = 0; 75 bShowLevel = false; 76 multiplier = 1; 77 b_combo = false;*/ 78 // spawn enemy every 3.5 seconds 79 //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&Jump::spawnEnemy, this))); 80 //comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&Jump::comboControll, this))); 81 } 70 71 } 72 82 73 83 74 /*void Jump::levelUp() … … 104 95 if (player == NULL) 105 96 { 106 ObjectList<JumpShip>::iterator it; 107 it = ObjectList<JumpShip>::begin(); 108 /*for (ObjectList<JumpShip>::iterator it = ObjectList<JumpShip>::begin(); it != ObjectList<JumpShip>::end(); ++it) 97 for (ObjectList<JumpShip>::iterator it = ObjectList<JumpShip>::begin(); it != ObjectList<JumpShip>::end(); ++it) 109 98 { 110 99 player = *it; 111 } */100 } 112 101 } 113 102 return player; 114 103 } 104 105 void Jump::tick(float dt) 106 { 107 108 109 if (getPlayer() != NULL) 110 { 111 Vector3 shipPosition = getPlayer()->getPosition(); 112 113 // Bildschirmposition kann nur nach oben verschoben werden 114 if (shipPosition.y > yScreenPosition) 115 { 116 screenShiftSinceLastUpdate += shipPosition.y - yScreenPosition; 117 118 yScreenPosition = shipPosition.y; 119 } 120 121 // Kameraposition nachfuehren 122 if (camera == NULL) 123 { 124 camera = getPlayer()->getCamera(); 125 } 126 if (camera != NULL) 127 { 128 camera->setPosition(Vector3(-shipPosition.x, yScreenPosition-shipPosition.y, 100)); 129 //camera->setOrientation(Vector3::UNIT_Z, Degree(180)); 130 } 131 132 if (screenShiftSinceLastUpdate > 200.0) 133 { 134 screenShiftSinceLastUpdate -= 200.0; 135 orxout() << "new section added" << endl; 136 addPlatform(shipPosition.x, shipPosition.y + 300.0); 137 } 138 139 } 140 141 SUPER(Jump, tick, dt); 142 } 143 115 144 116 145 /*void Jump::spawnEnemy() … … 158 187 }*/ 159 188 160 /*void Jump::start() 161 { 162 init(); 189 190 void Jump::start() 191 { 192 // Call start for the parent class. 193 Deathmatch::start(); 194 195 /* 163 196 // Set variable to temporarily force the player to spawn. 164 197 this->bForceSpawn_ = true; … … 170 203 return; 171 204 } 172 // Call start for the parent class. 173 Deathmatch::start(); 174 }*/ 205 */ 206 207 //addPlatform(0,0); 208 209 } 210 175 211 176 212 /*void Jump::addPoints(int numPoints) … … 191 227 GSLevel::startMainMenu(); 192 228 }*/ 229 230 void Jump::addPlatform(float xPosition, float yPosition) 231 { 232 JumpPlatform* newPlatform = new JumpPlatform(center_->getContext()); 233 newPlatform->setPosition(Vector3(xPosition, yPosition, 0)); 234 platformList.push_front(newPlatform); 235 } 236 193 237 }
Note: See TracChangeset
for help on using the changeset viewer.