Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11837


Ignore:
Timestamp:
Mar 29, 2018, 3:26:21 PM (7 years ago)
Author:
jacobsr
Message:

changed internal variables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoad.cc

    r11836 r11837  
    2828
    2929/**
    30     @file DodgeRace.cc
    31     @brief Implementation of the DodgeRace class.
     30    @file OrxyRoad.cc
     31    @brief Implementation of the OrxyRoad class.
    3232*/
    3333
    34 #include "DodgeRace.h"
    35 #include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
    36 #include "DodgeRaceCube.h"
     34#include "OrxyRoad.h"
     35#include "OrxyRoadShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
     36#include "OrxyRoadCube.h"
    3737#include "core/CoreIncludes.h"
    3838#include "Highscore.h"
     
    4141namespace orxonox
    4242{
    43     RegisterUnloadableClass(DodgeRace);
    44 
    45     DodgeRace::DodgeRace(Context* context) : Deathmatch(context)
    46     {
    47         RegisterObject(DodgeRace);
     43    RegisterUnloadableClass(OrxyRoad);
     44
     45    OrxyRoad::OrxyRoad(Context* context) : Deathmatch(context)
     46    {
     47        RegisterObject(OrxyRoad);
    4848
    4949        bEndGame = false;
     
    5858        lastPosition = 0;
    5959        // spawn enemy every 3.5 seconds
    60         //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this)));
    61         comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));
     60        //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&OrxyRoad::spawnEnemy, this)));
     61        comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&OrxyRoad::comboControll, this)));
    6262        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
    6363        this->center_ = nullptr;
    6464
    65         this->setHUDTemplate("DodgeRaceHUD");
    66     }
    67 
    68     void DodgeRace::levelUp()
     65        this->setHUDTemplate("OrxyRoadHUD");
     66    }
     67
     68    void OrxyRoad::levelUp()
    6969    {
    7070        level++;
     
    8686        multiplier *= 2;
    8787        toggleShowLevel();
    88         showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&DodgeRace::toggleShowLevel, this)));
    89     }
    90 
    91     void DodgeRace::tick(float dt)
    92     {
    93         DodgeRaceShip* player = this->getPlayer();
     88        showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&OrxyRoad::toggleShowLevel, this)));
     89    }
     90
     91    void OrxyRoad::tick(float dt)
     92    {
     93        OrxyRoadShip* player = this->getPlayer();
    9494        if (player != nullptr)
    9595        {
     
    114114                for(int i = 0; i<6; i++)
    115115                {
    116                     DodgeRaceCube* cube = new DodgeRaceCube(this->center_->getContext());
     116                    OrxyRoadCube* cube = new OrxyRoadCube(this->center_->getContext());
    117117                    cubeList.push_back(cube);
    118118                    switch(pattern)
    119119                    {
    120                     case 1: cube->addTemplate("DodgeRaceCube01");
     120                    case 1: cube->addTemplate("OrxyRoadCube01");
    121121                    break;
    122                     case 2: cube->addTemplate("DodgeRaceCube02");
     122                    case 2: cube->addTemplate("OrxyRoadCube02");
    123123                    break;
    124124
     
    136136
    137137        }
    138         SUPER(DodgeRace, tick, dt);
    139     }
    140 
    141     DodgeRaceShip* DodgeRace::getPlayer()
    142     {
    143         for (DodgeRaceShip* ship : ObjectList<DodgeRaceShip>())
     138        SUPER(OrxyRoad, tick, dt);
     139    }
     140
     141    OrxyRoadShip* OrxyRoad::getPlayer()
     142    {
     143        for (OrxyRoadShip* ship : ObjectList<OrxyRoadShip>())
    144144        {
    145145            return ship;
     
    148148    }
    149149
    150     void DodgeRace::costLife()
    151     {
    152         //endGameTimer.setTimer(8.0f, false, createExecutor(createFunctor(&DodgeRace::end, this)));
     150    void OrxyRoad::costLife()
     151    {
     152        //endGameTimer.setTimer(8.0f, false, createExecutor(createFunctor(&OrxyRoad::end, this)));
    153153        lives = 0;
    154154    };
    155155
    156     void DodgeRace::comboControll()
     156    void OrxyRoad::comboControll()
    157157    {
    158158        if (b_combo)
     
    164164    }
    165165
    166     void DodgeRace::start()
     166    void OrxyRoad::start()
    167167    {
    168168        orxout() << "start" << endl;
     
    179179        if (this->center_ == nullptr)  // abandon mission!
    180180        {
    181             orxout(internal_error) << "DodgeRace: No Centerpoint specified." << endl;
     181            orxout(internal_error) << "OrxyRoad: No Centerpoint specified." << endl;
    182182            GSLevel::startMainMenu();
    183183            return;
     
    187187    }
    188188
    189     void DodgeRace::playerPreSpawn(PlayerInfo* player)
     189    void OrxyRoad::playerPreSpawn(PlayerInfo* player)
    190190    {
    191191        this->playerInfo_ = player;
     
    210210    }
    211211
    212     void DodgeRace::addPoints(int numPoints)
     212    void OrxyRoad::addPoints(int numPoints)
    213213    {
    214214        if (!bEndGame)
     
    219219    }
    220220
    221     void DodgeRace::end()
     221    void OrxyRoad::end()
    222222    {
    223223        // DON'T CALL THIS!
Note: See TracChangeset for help on using the changeset viewer.