Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 12, 2014, 3:58:59 PM (11 years ago)
Author:
sriedel
Message:

Working atm. including function after function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRace.cc

    r10117 r10118  
    3333
    3434#include "DodgeRace.h"
    35 
    36 #include "core/CoreIncludes.h"
    37 #include "core/EventIncludes.h"
    38 #include "core/command/Executor.h"
    39 #include "core/config/ConfigValueIncludes.h"
    40 
    41 #include "gamestates/GSLevel.h"
    42 #include "chat/ChatManager.h"
    43 
    44 // ! HACK
    45 #include "infos/PlayerInfo.h"
    46 
    47 /*#include "DodgeRaceCenterPoint.h"
    48 #include "DodgeRaceShip.h"
    49 #include "DodgeRaceEnemy.h"
    50 #include "DodgeRaceEnemyShooter.h"
    51 */
    52 #include "core/command/ConsoleCommand.h"
    53 #include "worldentities/BigExplosion.h"
     35#include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
    5436
    5537namespace orxonox
    5638{
    57     RegisterClass(DodgeRace);
     39    RegisterUnloadableClass(DodgeRace);
    5840
    5941    DodgeRace::DodgeRace(Context* context) : Deathmatch(context)
    6042    {
    6143        RegisterObject(DodgeRace);
     44        init();
    6245        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
    63         this->center_ = NULL;
    64         init();
    65         this->setHUDTemplate("DodgeRaceHUD"); // !!!!!!!!!!!!!!!        change later
     46        this->center_ = 0;
     47        /*
     48        this->setHUDTemplate("DodgeRaceHUD"); // !!!!!!!!!!!!!!!        change later*/
    6649    }
    6750
     
    7558        multiplier = 1;
    7659        b_combo = false;
     60
    7761        // spawn enemy every 3.5 seconds
    7862        //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this)));
    79         //comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));
     63        comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));
    8064    }
    8165
     
    8367    {
    8468        level++;
    85         if (getPlayer() != NULL)
     69       /* if (getPlayer() != NULL)
    8670        {
    8771            for (int i = 0; i < 7; i++)
     
    9276                chunk->setScale(20);
    9377            }
    94         }
     78        }*/
    9579        addPoints(multiplier * 42);
    9680        multiplier *= 2;
     
    11094        return player;
    11195    }
    112 
    113     /*void DodgeRace::spawnEnemy()
     96/*
     97    void DodgeRace::spawnEnemy()
    11498    {
    11599        if (getPlayer() == NULL)
     
    134118            newPawn->setPosition(player->getPosition() + Vector3(500.f + 100 * i, 0, float(rand())/RAND_MAX * 400 - 200));
    135119        }
    136     }*/
     120    }
    137121
    138122    void DodgeRace::costLife()
     
    144128         //   enemySpawnTimer.setTimer(30.0f, false, createExecutor(createFunctor(&DodgeRace::end, this)));
    145129    };
    146 
     130*/
    147131    void DodgeRace::comboControll()
    148132    {
     
    161145        this->bForceSpawn_ = true;
    162146
    163         if (this->center_ == NULL)  // abandon mission!
     147        /*if (this->center_ == NULL)  // abandon mission!
    164148        {
    165149            orxout(internal_error) << "DodgeRace: No Centerpoint specified." << endl;
    166150            GSLevel::startMainMenu();
    167151            return;
    168         }
     152        }*/
    169153        // Call start for the parent class.
    170154        Deathmatch::start();
     
    178162        }
    179163    }
    180 
     164/*
    181165    void DodgeRace::end()
    182166    {
     
    186170        // Instead startMainMenu, this won't crash.
    187171        GSLevel::startMainMenu();
    188     }
     172    }*/
    189173}
Note: See TracChangeset for help on using the changeset viewer.