Changeset 11580 for code/branches/FlappyOrx_HS17/src/modules
- Timestamp:
- Nov 20, 2017, 4:19:40 PM (7 years ago)
- Location:
- code/branches/FlappyOrx_HS17/src/modules/flappyorx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc
r11576 r11580 51 51 #include "core/command/ConsoleCommand.h" 52 52 #include "worldentities/ExplosionPart.h" 53 53 #include <vector> 54 54 55 55 namespace orxonox … … 167 167 168 168 if(c.r<=5) 169 newAsteroid->addTemplate(Asteroid5[rand()% 6]);169 newAsteroid->addTemplate(Asteroid5[rand()%NUM_ASTEROIDS]); 170 170 else if(c.r<=10) 171 newAsteroid->addTemplate(Asteroid10[rand()% 6]);171 newAsteroid->addTemplate(Asteroid10[rand()%NUM_ASTEROIDS]); 172 172 else if(c.r<=15) 173 newAsteroid->addTemplate(Asteroid15[rand()% 6]);173 newAsteroid->addTemplate(Asteroid15[rand()%NUM_ASTEROIDS]); 174 174 else 175 newAsteroid->addTemplate(Asteroid20[rand()% 6]);175 newAsteroid->addTemplate(Asteroid20[rand()%NUM_ASTEROIDS]); 176 176 177 177 newAsteroid->setPosition(Vector3(c.x, 0, c.y)); … … 207 207 } 208 208 209 void FlappyOrx::comboControll()210 {211 if (b_combo)212 multiplier++;213 // if no combo was performed before, reset multiplier214 else215 multiplier = 1;216 b_combo = false;217 }218 219 209 void FlappyOrx::start() 220 210 { … … 231 221 Deathmatch::start(); 232 222 } 233 void FlappyOrx::addPoints(int numPoints) 234 { 235 if (!bEndGame) 236 { 237 point += numPoints * multiplier; 238 b_combo = true; 239 } 240 } 223 241 224 242 225 void FlappyOrx::death(){ 243 226 bIsDead = true; 244 227 245 if(point<10) sDeathMessage = DeathMessage10[rand()%( sizeof(DeathMessage10)/sizeof(*DeathMessage10))];246 else if(point<30) sDeathMessage = DeathMessage30[rand()%( sizeof(DeathMessage30)/sizeof(*DeathMessage30))];247 else if(point<50) sDeathMessage = DeathMessage50[rand()%( sizeof(DeathMessage50)/sizeof(*DeathMessage50))];248 else sDeathMessage = DeathMessageover50[rand()%( sizeof(DeathMessageover50)/sizeof(*DeathMessageover50))];228 if(point<10) sDeathMessage = DeathMessage10[rand()%(DeathMessage10.size())]; 229 else if(point<30) sDeathMessage = DeathMessage30[rand()%(DeathMessage30.size())]; 230 else if(point<50) sDeathMessage = DeathMessage50[rand()%(DeathMessage50.size())]; 231 else sDeathMessage = DeathMessageover50[rand()%(DeathMessageover50.size())]; 249 232 250 233 orxout()<<"message: "<<sDeathMessage<<std::endl; -
code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h
r11576 r11580 40 40 #include "gametypes/Deathmatch.h" 41 41 #include "tools/Timer.h" 42 42 #include <vector> 43 43 44 44 namespace orxonox 45 45 { 46 47 46 struct Circle{ 48 47 int r; … … 102 101 int spawnDistance; 103 102 int tubeOffsetX; 103 104 104 private: 105 105 void toggleShowLevel(){bShowLevel = !bShowLevel;} … … 155 155 bool b_combo; 156 156 157 const std::string Asteroid5[6] = {"Asteroid3_1","Asteroid3_2","Asteroid3_3","Asteroid3_4","Asteroid3_5","Asteroid3_6"}; 158 const std::string Asteroid10[6] = {"Asteroid6_1","Asteroid6_2","Asteroid6_3","Asteroid6_4","Asteroid6_5","Asteroid6_6"}; 159 const std::string Asteroid15[6] = {"Asteroid9_1","Asteroid9_2","Asteroid9_3","Asteroid9_4","Asteroid9_5","Asteroid9_6"}; 160 const std::string Asteroid20[6] = {"Asteroid12_1","Asteroid12_2","Asteroid12_3","Asteroid12_4","Asteroid12_5","Asteroid12_6"}; 157 const int NUM_ASTEROIDS = 5; 158 159 160 const std::string Asteroid5[5] = {"Asteroid3_1","Asteroid3_2","Asteroid3_3","Asteroid3_4","Asteroid3_5"}; 161 const std::string Asteroid10[5] = {"Asteroid6_1","Asteroid6_2","Asteroid6_3","Asteroid6_4","Asteroid6_5"}; 162 const std::string Asteroid15[5] = {"Asteroid9_1","Asteroid9_2","Asteroid9_3","Asteroid9_4","Asteroid9_5"}; 163 const std::string Asteroid20[5] = {"Asteroid12_1","Asteroid12_2","Asteroid12_3","Asteroid12_4","Asteroid12_5"}; 161 164 162 const std::string DeathMessage10[7]= {165 std::vector<std::string> DeathMessage10 = { 163 166 "You should really try that again", 164 167 "You can do better, can you?", 165 "Hey maybe you get a pa ticipation award, that's good isn't it?",166 " Hey congratulations, you get anmedal, a wooden one",168 "Hey maybe you get a participation award, that's good isn't it?", 169 "Congratulations, you get a medal, a wooden one", 167 170 "That was flappin bad!", 168 171 "Getting closer to something", 169 "Well that was a waste of time"};170 const std::string DeathMessage30[6]= {172 "Well, that was a waste of time"}; 173 std::vector<std::string> DeathMessage30 = { 171 174 "Getting better!", 172 175 "Training has paid off, huh?", … … 175 178 "Flappin average", 176 179 "That wasn't crap, not bad"}; 177 const std::string DeathMessage50[6]= {180 std::vector<std::string> DeathMessage50 = { 178 181 "Flappin great", 179 182 "Good job!", … … 182 185 "That was really good,!", 183 186 "We are proud of you"}; 184 const std::string DeathMessageover50[6]= {187 std::vector<std::string> DeathMessageover50 = { 185 188 "You're flappin amazing", 186 189 "Fucking great job",
Note: See TracChangeset
for help on using the changeset viewer.