Changeset 11182 for code/branches/tgidronFS16/src/modules/hover
- Timestamp:
- May 12, 2016, 1:45:44 PM (9 years ago)
- Location:
- code/branches/tgidronFS16/src/modules/hover
- Files:
-
- 4 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 -
code/branches/tgidronFS16/src/modules/hover/Hover.h
r11177 r11182 94 94 95 95 std::vector<PickupSpawner*> pickupSpawners_; 96 96 97 }; 97 98 } -
code/branches/tgidronFS16/src/modules/hover/HoverOrigin.cc
r11177 r11182 46 46 checkGametype(); 47 47 48 pickupTemplate_ = ""; 48 //not needed 49 50 /*pickupTemplate_ = ""; 49 51 pickupRepresentationTemplate_ = ""; 50 52 51 pickupTemplateDam_ = ""; 52 pickupRepresentationTemplateDam_ = ""; 53 pickupTemplateSpeed_ = ""; 54 pickupRepresentationTemplateSpeed_ = ""; 55 56 57 pickupTemplateShrink_ = ""; 58 pickupRepresentationTemplateShrink_ = "";*/ 53 59 } 54 60 … … 62 68 XMLPortParam(HoverOrigin, "pickuptemplate", setPickupTemplate, getPickupTemplate, xmlelement, mode); 63 69 XMLPortParam(HoverOrigin, "pickuprepresentationtemplate", setPickupRepresentationTemplate, getPickupRepresentationTemplate, xmlelement, mode); 64 XMLPortParam(HoverOrigin, "pickuptemplate dam", setPickupTemplateDam, getPickupTemplateDam, xmlelement, mode);65 XMLPortParam(HoverOrigin, "pickuprepresentationtemplate dam", setPickupRepresentationTemplateDam, getPickupRepresentationTemplateDam, xmlelement, mode);70 XMLPortParam(HoverOrigin, "pickuptemplatespeed", setPickupTemplateSpeed, getPickupTemplateSpeed, xmlelement, mode); 71 XMLPortParam(HoverOrigin, "pickuprepresentationtemplatespeed", setPickupRepresentationTemplateSpeed, getPickupRepresentationTemplateSpeed, xmlelement, mode); 66 72 XMLPortParam(HoverOrigin, "obstacletemplate", setObstacleTemplate, getObstacleTemplate, xmlelement, mode); 73 XMLPortParam(HoverOrigin, "pickuptemplateshrink", setPickupTemplateShrink, getPickupTemplateShrink, xmlelement, mode); 74 XMLPortParam(HoverOrigin, "pickuprepresentationtemplateshrink", setPickupRepresentationTemplateShrink, getPickupRepresentationTemplateShrink, xmlelement, mode); 67 75 } 68 76 -
code/branches/tgidronFS16/src/modules/hover/HoverOrigin.h
r11177 r11182 80 80 //pickup template get and set for damage hover pickup 81 81 82 inline void setPickupTemplate Dam(std::string pickupTemplateDam)83 { this->pickupTemplate Dam_ = pickupTemplateDam; }84 inline std::string getPickupTemplate Dam() const85 { return this->pickupTemplate Dam_; }82 inline void setPickupTemplateSpeed(std::string pickupTemplateSpeed) 83 { this->pickupTemplateSpeed_ = pickupTemplateSpeed; } 84 inline std::string getPickupTemplateSpeed() const 85 { return this->pickupTemplateSpeed_; } 86 86 87 inline void setPickupRepresentationTemplateDam(std::string pickupRepresenationaTemplateDam) 88 { this->pickupRepresentationTemplateDam_ = pickupRepresenationaTemplateDam; } 89 inline std::string getPickupRepresentationTemplateDam() const 90 { return this->pickupRepresentationTemplateDam_; } 87 inline void setPickupRepresentationTemplateSpeed(std::string pickupRepresenationaTemplateSpeed) 88 { this->pickupRepresentationTemplateSpeed_ = pickupRepresenationaTemplateSpeed; } 89 inline std::string getPickupRepresentationTemplateSpeed() const 90 { return this->pickupRepresentationTemplateSpeed_; } 91 92 93 //pickup template get and set for shrink hover pickup 94 95 inline void setPickupTemplateShrink(std::string pickupTemplateShrink) 96 { this->pickupTemplateShrink_ = pickupTemplateShrink; } 97 inline std::string getPickupTemplateShrink() const 98 { return this->pickupTemplateShrink_; } 99 100 inline void setPickupRepresentationTemplateShrink(std::string pickupRepresenationaTemplateShrink) 101 { this->pickupRepresentationTemplateShrink_ = pickupRepresenationaTemplateShrink; } 102 inline std::string getPickupRepresentationTemplateShrink() const 103 { return this->pickupRepresentationTemplateShrink_; } 91 104 92 105 //get and set for obstacle template … … 110 123 111 124 // Tempaltes for the damage hover pickup 112 std::string pickupTemplateDam_; 113 std::string pickupRepresentationTemplateDam_; 125 std::string pickupTemplateSpeed_; 126 std::string pickupRepresentationTemplateSpeed_; 127 128 // Tempaltes for the shrink hover pickup 129 std::string pickupTemplateShrink_; 130 std::string pickupRepresentationTemplateShrink_; 114 131 115 132 //Template for crate obstacle
Note: See TracChangeset
for help on using the changeset viewer.