Changeset 11182 for code/branches/tgidronFS16/src/modules/hover/Hover.cc
- Timestamp:
- May 12, 2016, 1:45:44 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/tgidronFS16/src/modules/hover/Hover.cc
r11177 r11182 121 121 122 122 123 //Generate 5PickupSpawners randomly (destroy hover pickup)124 for (int i = 0; i< 5; i++)123 //Generate 3 PickupSpawners randomly (destroy hover pickup) 124 for (int i = 0; i<3; i++) 125 125 { 126 126 PickupSpawner* pickupSpawner = new PickupSpawner(origin_->getContext()); … … 128 128 pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 10.0f)); 129 129 pickupSpawner->setPickupTemplateName(origin_->getPickupTemplate()); 130 pickupSpawner->setMaxSpawnedItems( 5);130 pickupSpawner->setMaxSpawnedItems(3); 131 131 pickupSpawner->setRespawnTime(30); 132 132 pickupSpawner->setTriggerDistance(5); … … 135 135 } 136 136 137 //Generate 5 PickupSpawners randomly (damagepickup)138 for (int i = 0; i< 5; i++)137 //Generate 3 PickupSpawners randomly (speed pickup) 138 for (int i = 0; i<3; i++) 139 139 { 140 140 PickupSpawner* pickupSpawner = new PickupSpawner(origin_->getContext()); 141 141 142 142 pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 10.0f)); 143 pickupSpawner->setPickupTemplateName(origin_->getPickupTemplate Dam());144 pickupSpawner->setMaxSpawnedItems( 5);143 pickupSpawner->setPickupTemplateName(origin_->getPickupTemplateSpeed()); 144 pickupSpawner->setMaxSpawnedItems(3); 145 145 pickupSpawner->setRespawnTime(30); 146 146 pickupSpawner->setTriggerDistance(5); … … 149 149 } 150 150 151 //Generate 3 PickupSpawners randomly (shrink pickup) 152 for (int i = 0; i<3; i++) 153 { 154 PickupSpawner* pickupSpawner = new PickupSpawner(origin_->getContext()); 155 156 pickupSpawner->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 10.0f)); 157 pickupSpawner->setPickupTemplateName(origin_->getPickupTemplateShrink()); 158 pickupSpawner->setMaxSpawnedItems(3); 159 pickupSpawner->setRespawnTime(30); 160 pickupSpawner->setTriggerDistance(5); 161 // Add pickup spawner to the pickup spawner list 162 pickupSpawners_.push_back(pickupSpawner); 163 } 164 151 165 //***************************************************************************** 152 166 167 //Generate a destroyable crate randomly on field 168 153 169 Pawn* crate = new Pawn(origin_->getContext()); 154 170 155 171 crate->setPosition(get3dCoordinates(rand()%numCells, rand()%numCells, 10.0f)); 156 crate->addTemplate(origin_->getObstacleTemplate()); 157 172 crate->addTemplate(origin_->getObstacleTemplate()); 173 crate->setInitialHealth(100.0f); 174 158 175 159 176 160 177 161 178 //If no lives are left, end game 162 if(lives <= 0){ 179 if(lives <= 0) 180 { 163 181 GSLevel::startMainMenu(); 164 182 } 165 183 // Debug 166 184 orxout() << this->origin_->getPickupTemplate() << endl; 167 185 orxout() << this->origin_->getPickupRepresentationTemplate() << endl; 168 186 169 orxout() << this->origin_->getPickupTemplateDam() << endl; 170 orxout() << this->origin_->getPickupRepresentationTemplateDam() << endl; 171 } 187 orxout() << this->origin_->getPickupTemplateSpeed() << endl; 188 orxout() << this->origin_->getPickupRepresentationTemplateSpeed() << endl; 189 190 orxout() << this->origin_->getObstacleTemplate() << endl; 191 orxout() << crate->getPosition() << endl; 192 } 172 193 } 173 194
Note: See TracChangeset
for help on using the changeset viewer.