[Orxonox-commit 7223] r11837 - code/branches/OrxyRoad_FS18/src/modules/orxyroad
jacobsr at orxonox.net
jacobsr at orxonox.net
Thu Mar 29 15:26:23 CEST 2018
Author: jacobsr
Date: 2018-03-29 15:26:21 +0200 (Thu, 29 Mar 2018)
New Revision: 11837
Modified:
code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoad.cc
Log:
changed internal variables
Modified: code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoad.cc
===================================================================
--- code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoad.cc 2018-03-29 13:13:14 UTC (rev 11836)
+++ code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoad.cc 2018-03-29 13:26:21 UTC (rev 11837)
@@ -27,13 +27,13 @@
*/
/**
- @file DodgeRace.cc
- @brief Implementation of the DodgeRace class.
+ @file OrxyRoad.cc
+ @brief Implementation of the OrxyRoad class.
*/
-#include "DodgeRace.h"
-#include "DodgeRaceShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
-#include "DodgeRaceCube.h"
+#include "OrxyRoad.h"
+#include "OrxyRoadShip.h" // Necessary for getPlayer function. Do NOT include this in Header!
+#include "OrxyRoadCube.h"
#include "core/CoreIncludes.h"
#include "Highscore.h"
#include "infos/PlayerInfo.h"
@@ -40,11 +40,11 @@
namespace orxonox
{
- RegisterUnloadableClass(DodgeRace);
+ RegisterUnloadableClass(OrxyRoad);
- DodgeRace::DodgeRace(Context* context) : Deathmatch(context)
+ OrxyRoad::OrxyRoad(Context* context) : Deathmatch(context)
{
- RegisterObject(DodgeRace);
+ RegisterObject(OrxyRoad);
bEndGame = false;
lives = 1;
@@ -57,15 +57,15 @@
pattern = 1;
lastPosition = 0;
// spawn enemy every 3.5 seconds
- //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this)));
- comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));
+ //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&OrxyRoad::spawnEnemy, this)));
+ comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&OrxyRoad::comboControll, this)));
this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
this->center_ = nullptr;
- this->setHUDTemplate("DodgeRaceHUD");
+ this->setHUDTemplate("OrxyRoadHUD");
}
- void DodgeRace::levelUp()
+ void OrxyRoad::levelUp()
{
level++;
if (getPlayer() != nullptr)
@@ -85,12 +85,12 @@
addPoints(multiplier * 42);
multiplier *= 2;
toggleShowLevel();
- showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&DodgeRace::toggleShowLevel, this)));
+ showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&OrxyRoad::toggleShowLevel, this)));
}
- void DodgeRace::tick(float dt)
+ void OrxyRoad::tick(float dt)
{
- DodgeRaceShip* player = this->getPlayer();
+ OrxyRoadShip* player = this->getPlayer();
if (player != nullptr)
{
currentPosition = player->getWorldPosition().x;
@@ -113,13 +113,13 @@
counter = 0;
for(int i = 0; i<6; i++)
{
- DodgeRaceCube* cube = new DodgeRaceCube(this->center_->getContext());
+ OrxyRoadCube* cube = new OrxyRoadCube(this->center_->getContext());
cubeList.push_back(cube);
switch(pattern)
{
- case 1: cube->addTemplate("DodgeRaceCube01");
+ case 1: cube->addTemplate("OrxyRoadCube01");
break;
- case 2: cube->addTemplate("DodgeRaceCube02");
+ case 2: cube->addTemplate("OrxyRoadCube02");
break;
}
@@ -135,12 +135,12 @@
}
}
- SUPER(DodgeRace, tick, dt);
+ SUPER(OrxyRoad, tick, dt);
}
- DodgeRaceShip* DodgeRace::getPlayer()
+ OrxyRoadShip* OrxyRoad::getPlayer()
{
- for (DodgeRaceShip* ship : ObjectList<DodgeRaceShip>())
+ for (OrxyRoadShip* ship : ObjectList<OrxyRoadShip>())
{
return ship;
}
@@ -147,13 +147,13 @@
return nullptr;
}
- void DodgeRace::costLife()
+ void OrxyRoad::costLife()
{
- //endGameTimer.setTimer(8.0f, false, createExecutor(createFunctor(&DodgeRace::end, this)));
+ //endGameTimer.setTimer(8.0f, false, createExecutor(createFunctor(&OrxyRoad::end, this)));
lives = 0;
};
- void DodgeRace::comboControll()
+ void OrxyRoad::comboControll()
{
if (b_combo)
multiplier++;
@@ -163,7 +163,7 @@
b_combo = false;
}
- void DodgeRace::start()
+ void OrxyRoad::start()
{
orxout() << "start" << endl;
for(unsigned int i=0; i< cubeList.size();i++)
@@ -178,7 +178,7 @@
if (this->center_ == nullptr) // abandon mission!
{
- orxout(internal_error) << "DodgeRace: No Centerpoint specified." << endl;
+ orxout(internal_error) << "OrxyRoad: No Centerpoint specified." << endl;
GSLevel::startMainMenu();
return;
}
@@ -186,7 +186,7 @@
Deathmatch::start();
}
- void DodgeRace::playerPreSpawn(PlayerInfo* player)
+ void OrxyRoad::playerPreSpawn(PlayerInfo* player)
{
this->playerInfo_ = player;
if(lives <= 0)
@@ -209,7 +209,7 @@
*/
}
- void DodgeRace::addPoints(int numPoints)
+ void OrxyRoad::addPoints(int numPoints)
{
if (!bEndGame)
{
@@ -218,7 +218,7 @@
}
}
- void DodgeRace::end()
+ void OrxyRoad::end()
{
// DON'T CALL THIS!
// Deathmatch::end();
More information about the Orxonox-commit
mailing list