[Orxonox-commit 4278] r8949 - in code/branches/spaceraceTwo: data/levels src/modules/gametypes src/orxonox/gametypes src/orxonox/infos
eceline at orxonox.net
eceline at orxonox.net
Wed Nov 23 16:16:16 CET 2011
Author: eceline
Date: 2011-11-23 16:16:15 +0100 (Wed, 23 Nov 2011)
New Revision: 8949
Modified:
code/branches/spaceraceTwo/data/levels/Spacerace2.oxw
code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc
code/branches/spaceraceTwo/src/orxonox/gametypes/Gametype.cc
code/branches/spaceraceTwo/src/orxonox/infos/GametypeInfo.cc
Log:
level Spacerace2 works now
Modified: code/branches/spaceraceTwo/data/levels/Spacerace2.oxw
===================================================================
--- code/branches/spaceraceTwo/data/levels/Spacerace2.oxw 2011-11-23 15:06:18 UTC (rev 8948)
+++ code/branches/spaceraceTwo/data/levels/Spacerace2.oxw 2011-11-23 15:16:15 UTC (rev 8949)
@@ -52,9 +52,20 @@
</checkpoints>
</SpaceRaceManager>
+ <SpaceShip position="0,2000,2000" lookat="0,0,0" team=1 >
+ <templates>
+ <Template link=spaceshipassff />
+ </templates>
+ <controller>
+ <WaypointPatrolController alertnessradius=1500 team=0 >
+ <waypoints>
+ <Model scale=0 position="0,2000,2000" />
+ </waypoints>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
-
<SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff2 />
Modified: code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc 2011-11-23 15:06:18 UTC (rev 8948)
+++ code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc 2011-11-23 15:16:15 UTC (rev 8949)
@@ -38,27 +38,31 @@
namespace orxonox
{
CreateFactory(RaceCheckPoint);
+
+
RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))
{
RegisterObject(RaceCheckPoint);
-
+
+
+
this->bCheckpointIndex_ = 0;
//this->bIsLast_ = false;
this->bTimeLimit_ = 0;
- this->isVisible_=false;
+ this->isVisible_=true;
this->setRadarObjectColour(ColourValue::Blue);
this->setRadarObjectShape(RadarViewable::Triangle);
- this->setRadarVisibility(false);
+ this->setRadarVisibility(true);
}
RaceCheckPoint::~RaceCheckPoint()
{
//if (this->isInitialized())
{
- //for (size_t i = 0; i < this->nextcheckpoints_.size(); ++i)
- // this->nextcheckpoints_[i]->destroy();
+ //for (size_t i = 0; i < 3; ++i)
+ // this->nextcheckpoints_[i]->destroy();
}
//nextcheckpoints_.destroy;
}
@@ -71,6 +75,8 @@
assert(gametype);
if(this->isVisible_){this->setRadarVisibility(true);}
else{this->setRadarVisibility(false);}
+
+
/*this->setRadarVisibility(false);
Vector3 v =Vector3(0,0,0);
int j=0;
Modified: code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc 2011-11-23 15:06:18 UTC (rev 8948)
+++ code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc 2011-11-23 15:16:15 UTC (rev 8949)
@@ -45,13 +45,13 @@
{
RegisterObject(SpaceRace);
- const std::string& message = "SpaceRace constructed";
- orxout()<< message << endl;
+
this->bTimeIsUp_ = false;
this->numberOfBots_ = 0;
this->cantMove_=false;
+
for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
{this->checkpointReached_[it->first]=0;}
@@ -96,9 +96,9 @@
}
void SpaceRace::start()
- {
- Gametype::start();
- this->spawnPlayersIfRequested(); //Gametype::checkStart();
+ {
+ //Gametype::start();
+ this->spawnPlayersIfRequested(); Gametype::checkStart();
this->cantMove_=true;
for(ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
@@ -116,7 +116,7 @@
}
this->addBots(this->numberOfBots_);
-
+
}
void SpaceRace::tick(float dt){
@@ -143,7 +143,7 @@
}
void SpaceRace::setV(SpaceRaceManager* m){
- Vector3 v =Vector3(0,0,0);
+ /*Vector3 v =Vector3(0,0,0);
int j=0;
for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)
{
@@ -151,11 +151,12 @@
RaceCheckPoint* r=m->getCheckpoint(j);
v=r->getNextcheckpoint();
for(int i=1;i<4;i++){
- RaceCheckPoint* n=m->getCheckpoint(i);
+ if(v[i]==0){
+ RaceCheckPoint* n=m->getCheckpoint(v[i]);
n->setV(true);
- }
+ }}
+ }*/
}
- }
void SpaceRace::newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl)
{
@@ -190,17 +191,19 @@
void SpaceRace::playerEntered(PlayerInfo* player){
- this->checkpointReached_[player]=0;
- this->playersAlive_++;
+ Gametype::playerEntered(player);
+ //this->checkpointReached_[player]=0;
+ //this->playersAlive_++;
}
bool SpaceRace::playerLeft(PlayerInfo* player){
- bool valid_player = true;
- if (valid_player)
- {
- this->playersAlive_--;
- }
+ return Gametype::playerLeft(player);
+ // bool valid_player = true;
+ //if (valid_player)
+ // {
+ // this->playersAlive_--;
+ //}
- return valid_player;
+ // return valid_player;
}
}
Modified: code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc 2011-11-23 15:06:18 UTC (rev 8948)
+++ code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc 2011-11-23 15:16:15 UTC (rev 8949)
@@ -45,8 +45,7 @@
{
RegisterObject(SpaceRaceManager);
- const std::string& message = "SpaceRaceManager constructed";
- orxout()<< message << endl;
+
}
SpaceRaceManager::~SpaceRaceManager()
Modified: code/branches/spaceraceTwo/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/branches/spaceraceTwo/src/orxonox/gametypes/Gametype.cc 2011-11-23 15:06:18 UTC (rev 8948)
+++ code/branches/spaceraceTwo/src/orxonox/gametypes/Gametype.cc 2011-11-23 15:16:15 UTC (rev 8949)
@@ -133,12 +133,9 @@
}
-
- const std::string& message = "Gametype should start";
- orxout()<< message << endl;
- this->start();
- const std::string& message2 = "Gametype should have started";
- orxout()<< message2 << endl;
+
+ this->checkStart();
+
}
else if (!this->gtinfo_->hasEnded())
@@ -148,8 +145,7 @@
}
void Gametype::start()
- { const std::string& message = "Gametype starts";
- orxout()<< message << endl;
+ {
this->addBots(this->numberOfBots_);
@@ -157,7 +153,7 @@
this->spawnPlayersIfRequested();
-
+
}
void Gametype::end()
@@ -386,7 +382,7 @@
if (this->gtinfo_->getStartCountdown() <= 0.0f)
{
this->gtinfo_->stopStartCountdown();
- this->gtinfo_->setStartCountdown(0.0f);;
+ this->gtinfo_->setStartCountdown(0.0f);
this->start();
}
}
@@ -407,6 +403,7 @@
if (it->first->isHumanPlayer())
hashumanplayers = true;
}
+
if (allplayersready && hashumanplayers)
{
// If in developer's mode, there is no start countdown.
@@ -418,6 +415,7 @@
}
}
}
+
}
}
Modified: code/branches/spaceraceTwo/src/orxonox/infos/GametypeInfo.cc
===================================================================
--- code/branches/spaceraceTwo/src/orxonox/infos/GametypeInfo.cc 2011-11-23 15:06:18 UTC (rev 8948)
+++ code/branches/spaceraceTwo/src/orxonox/infos/GametypeInfo.cc 2011-11-23 15:16:15 UTC (rev 8949)
@@ -163,14 +163,12 @@
void GametypeInfo::start(void)
{
if(this->bStarted_)
- {const std::string& message = "bStarted true";
- orxout()<< message << endl; return;}
+ { return;}
this->bStarted_ = true;
this->changedStarted();
- const std::string& message = "bStarted true";
- orxout()<< message << endl;
+
}
/**
More information about the Orxonox-commit
mailing list