Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 13, 2017, 3:44:45 PM (7 years ago)
Author:
pascscha
Message:

Increasing difficulty

Location:
code/branches/FlappyOrx_HS17
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FlappyOrx_HS17/data/levels/FlappyOrx.oxw

    r11529 r11554  
    3232  <Scene
    3333    ambientlight = "0.8, 0.7, 0.4"
    34     skybox     = "Orxonox/skyBoxBasic"
     34    skybox     = "Orxonox/skyBoxFlappyOrx"
    3535  >
    3636
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrx.cc

    r11537 r11554  
    6868        multiplier = 1;
    6969        b_combo = false;
    70         this->spawnDistance=300;
     70        this->spawnDistance=200;
    7171        this->tubeOffsetX=500;
    7272        this->setHUDTemplate("FlappyOrxHUD");
     
    7575    void FlappyOrx::updatePlayerPos(int x){
    7676
    77         if(this->tubes.size()==0||x-this->tubes.back()-tubeOffsetX>spawnDistance){
     77        if(this->tubes.size()==0||x-tubes.back()+tubeOffsetX>spawnDistance){
     78            orxout()<<"true: ";
    7879            spawnTube();
    7980            this->tubes.push(x+tubeOffsetX);
    8081        }
     82        else{
     83            orxout()<<"false:";
     84        }
     85        orxout()<<"x("<<x<<")- tubes.back()("<<tubes.back()<<") + tubeOffsetX("<<tubeOffsetX<<") > spawnDistance("<<spawnDistance<<")"<<std::endl;
    8186        if(this->tubes.size()!=0&&x>this->tubes.front()){
    8287            this->tubes.pop();
    8388            levelUp();
    84             point++;
    8589        }
    8690        while((this->asteroids.front())->getPosition().x<x-300){
     
    9397    void FlappyOrx::levelUp()
    9498    {
    95         level++;
     99        point++;
     100        spawnDistance = 300-3*point;
     101        getPlayer()->setSpeed(100+.5*point);
    96102        toggleShowLevel();
    97103        //showLevelTimer.setTimer(3.0f, false, createExecutor(createFunctor(&FlappyOrx::toggleShowLevel, this)));
     
    111117    void FlappyOrx::spawnTube()
    112118    {
    113         int space = 90;
     119        int space = 120;
    114120        int height = (float(rand())/RAND_MAX-0.5)*(280-space);
    115121           
     
    129135        ClearAsteroids();
    130136        Circle newAsteroid = Circle();
     137        newAsteroid.x=x;
     138        newAsteroid.y=y;
     139        newAsteroid.r=r;
     140        addIfPossible(newAsteroid);
    131141        while(r>0){
    132142            if(slope>0)
     
    224234        if (Highscore::exists()){
    225235                    int score = this->getPoints();
    226                     if(score > Highscore::getInstance().getHighestScoreOfGame("Orxonox Arcade"))
    227                         Highscore::getInstance().storeHighscore("Orxonox Arcade",score);
    228 
    229         }
    230         point = 0;
     236                    if(score > Highscore::getInstance().getHighestScoreOfGame("Flappy Orx"))
     237                        Highscore::getInstance().storeHighscore("Flappy Orx",score);
     238
     239        }
     240        point = -1;
     241        level=-1;
     242        levelUp();
    231243        while (!tubes.empty())
    232244        {
  • code/branches/FlappyOrx_HS17/src/modules/flappyorx/FlappyOrxShip.cc

    r11543 r11554  
    5454       
    5555    }
     56
     57   
    5658    void FlappyOrxShip::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    5759        {   
Note: See TracChangeset for help on using the changeset viewer.