Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 20, 2017, 4:19:40 PM (7 years ago)
Author:
merholzl
Message:

colisson boxes and asteroidshapoeremoval

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  
    5151#include "core/command/ConsoleCommand.h"
    5252#include "worldentities/ExplosionPart.h"
    53 
     53#include <vector>
    5454
    5555namespace orxonox
     
    167167
    168168        if(c.r<=5)
    169             newAsteroid->addTemplate(Asteroid5[rand()%6]);
     169            newAsteroid->addTemplate(Asteroid5[rand()%NUM_ASTEROIDS]);
    170170        else if(c.r<=10)
    171             newAsteroid->addTemplate(Asteroid10[rand()%6]);
     171            newAsteroid->addTemplate(Asteroid10[rand()%NUM_ASTEROIDS]);
    172172        else if(c.r<=15)
    173             newAsteroid->addTemplate(Asteroid15[rand()%6]);
     173            newAsteroid->addTemplate(Asteroid15[rand()%NUM_ASTEROIDS]);
    174174        else
    175             newAsteroid->addTemplate(Asteroid20[rand()%6]);
     175            newAsteroid->addTemplate(Asteroid20[rand()%NUM_ASTEROIDS]);
    176176       
    177177        newAsteroid->setPosition(Vector3(c.x, 0, c.y));
     
    207207    }
    208208
    209     void FlappyOrx::comboControll()
    210     {
    211         if (b_combo)
    212             multiplier++;
    213         // if no combo was performed before, reset multiplier
    214         else
    215             multiplier = 1;
    216         b_combo = false;
    217     }
    218 
    219209    void FlappyOrx::start()
    220210    {
     
    231221        Deathmatch::start();
    232222    }
    233     void FlappyOrx::addPoints(int numPoints)
    234     {
    235         if (!bEndGame)
    236         {
    237             point += numPoints * multiplier;
    238             b_combo = true;
    239         }
    240     }
     223
    241224
    242225    void FlappyOrx::death(){
    243226        bIsDead = true;
    244227       
    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())];
    249232       
    250233        orxout()<<"message: "<<sDeathMessage<<std::endl;
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.h

    r11576 r11580  
    4040#include "gametypes/Deathmatch.h"
    4141#include "tools/Timer.h"
    42 
     42#include <vector>
    4343
    4444namespace orxonox
    4545{
    46 
    4746    struct Circle{
    4847        int r;
     
    102101            int spawnDistance;
    103102            int tubeOffsetX;
     103
    104104        private:
    105105            void toggleShowLevel(){bShowLevel = !bShowLevel;}
     
    155155            bool b_combo;
    156156
    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"};
    161164           
    162             const std::string DeathMessage10[7] = {
     165            std::vector<std::string> DeathMessage10 = {
    163166                "You should really try that again",
    164167                "You can do better, can you?",
    165                 "Hey maybe you get a paticipation award, that's good isn't it?",
    166                 "Hey congratulations, you get an medal, 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",
    167170                "That was flappin bad!",
    168171                "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 = {
    171174                "Getting better!",
    172175                "Training has paid off, huh?",
     
    175178                "Flappin average",
    176179                "That wasn't crap, not bad"};
    177             const std::string DeathMessage50[6] = {
     180            std::vector<std::string> DeathMessage50 = {
    178181                "Flappin great",
    179182                "Good job!",
     
    182185                "That was really good,!",
    183186                "We are proud of you"};
    184             const std::string DeathMessageover50[6] = {
     187            std::vector<std::string> DeathMessageover50 = {
    185188                "You're flappin amazing",
    186189                "Fucking great job",
Note: See TracChangeset for help on using the changeset viewer.