[Orxonox-commit 4308] r8979 - in code/branches/spaceraceTwo: data/levels src/modules/gametypes
eceline at orxonox.net
eceline at orxonox.net
Wed Dec 14 14:16:45 CET 2011
Author: eceline
Date: 2011-12-14 14:16:45 +0100 (Wed, 14 Dec 2011)
New Revision: 8979
Modified:
code/branches/spaceraceTwo/data/levels/Spacerace2.oxw
code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc
code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h
code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc
Log:
not much changed
Modified: code/branches/spaceraceTwo/data/levels/Spacerace2.oxw
===================================================================
--- code/branches/spaceraceTwo/data/levels/Spacerace2.oxw 2011-12-14 13:15:45 UTC (rev 8978)
+++ code/branches/spaceraceTwo/data/levels/Spacerace2.oxw 2011-12-14 13:16:45 UTC (rev 8979)
@@ -96,9 +96,9 @@
<controller>
<WaypointPatrolController alertnessradius=1000 team=10>
<waypoints>
- <Model mesh="cube.mesh" scale=8 position="0,-2000,1000" />
- <Model mesh="cube.mesh" scale=8 position="0,2100,2300" />
- <Model mesh="cube.mesh" scale=8 position="0,-400,300" />
+ <Model mesh="cube.mesh" scale=0 position="0,-2000,1000" />
+ <Model mesh="cube.mesh" scale=0 position="0,2100,2300" />
+ <Model mesh="cube.mesh" scale=0 position="0,-400,300" />
</waypoints>
</WaypointPatrolController>
</controller>
@@ -107,8 +107,99 @@
<SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
-
+ <!-- ------------------Planet----------------- -->
+ <Planet position="0,0,0" scale=300 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="8,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
+ <StaticEntity position="0,0,0" collisionType=static>
+ <collisionShapes>
+ <SphereCollisionShape radius="399" />
+ </collisionShapes>
+ </StaticEntity>
+ <!-- ---------------asteroid ellipse----------------- -->
+ <?lua
+ max = 20
+ for i = 0, max, 1
+ do
+ y = math.sin(i/max*6)*2000
+ z = math.cos(i/max*6)*2500
+ x = 0
+ ?>
+ <?lua
+ for k = 1, 15, 1
+ do
+ j = math.random()
+ ?>
+
+ <MovableEntity
+ position = "<?lua print(x + math.random() * 500) ?>,<?lua print(y + math.random() * 500) ?>,<?lua print(z + math.random() * 1000) ?>"
+ collisionType = "dynamic"
+ linearDamping = "0.5"
+ angularDamping = "0.01"
+ collisiondamage = "0.01"
+ enablecollisiondamage = "true"
+ scale="<?lua print(j * 5) ?>" >
+ <attached>
+ <Model position="0,0,0" scale="<?lua print(j * 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh">
+ <?lua if k == 5 then ?><attached><!-- ---------asteroid fog----- -->
+ <ParticleEmitter position="0,0,0" source="Orxonox/Steam" />
+ </attached> <?lua end ?>
+ </Model>
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="<?lua print(j * 80) ?>" />
+ </collisionShapes>
+ </MovableEntity>
+ <?lua
+ end
+ ?>
+ <?lua end ?>
+
+ <!-- ---------------ForceFields----------------- -->
+ <ForceField position="0,-700,2700" direction="0,1,0" diameter=500 velocity=2000 length=600 />
+ <MovableEntity position="0,-400,2700">
+ <attached>
+ <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+ <?lua for i=0,15,1 do ?>
+ <Billboard position="-200,<?lua print(i*40) ?>,0" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <Billboard position="200,<?lua print(i*40) ?>,0" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <?lua end ?>
+ </attached>
+ </MovableEntity>
+
+ <ForceField position="0,2500,2000" direction="0,0,-1" diameter=250 velocity=2000 length=600 />
+ <MovableEntity position="0,2500,2000">
+ <attached>
+ <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+ <?lua for i=0,15,1 do ?>
+ <Billboard position="-100,0,-<?lua print(i*40) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <Billboard position="100,0,-<?lua print(i*40) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <?lua end ?>
+ </attached>
+ </MovableEntity>
+
+ <ForceField position="0,1300,-800" direction="0,-1,-1" diameter=250 velocity=2000 length=800 />
+ <MovableEntity position="0,1300,-800">
+ <attached>
+ <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+ <?lua for i=0,20,1 do ?>
+ <Billboard position="-100,<?lua print(-i*40*0.7071) ?>,<?lua print(-i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <Billboard position="100,<?lua print(-i*40*0.7071) ?>,<?lua print(-i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <?lua end ?>
+ </attached>
+ </MovableEntity>
+
+ <ForceField position="0,-1400,-700" direction="0,-1,1" diameter=250 velocity=2000 length=600 />
+ <MovableEntity position="0,-1400,-700">
+ <attached>
+ <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.5,0,0" scale=2/>
+ <?lua for i=0,15,1 do ?>
+ <Billboard position="-100,<?lua print(-i*40*0.7071) ?>,<?lua print(i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <Billboard position="100,<?lua print(-i*40*0.7071) ?>,<?lua print(i*40*0.7071) ?>" material="Examples/Flare" colour="0.5,0,0" scale=1/>
+ <?lua end ?>
+ </attached>
+ </MovableEntity>
+
+
</Scene>
</Level>
Modified: code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc 2011-12-14 13:15:45 UTC (rev 8978)
+++ code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.cc 2011-12-14 13:16:45 UTC (rev 8979)
@@ -58,7 +58,7 @@
this->setRadarVisibility(false);
this->settingsChanged();
this->reached_=NULL;
- //this->addTarget("WorldEntity");
+
}
Modified: code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h 2011-12-14 13:15:45 UTC (rev 8978)
+++ code/branches/spaceraceTwo/src/modules/gametypes/RaceCheckPoint.h 2011-12-14 13:16:45 UTC (rev 8979)
@@ -41,7 +41,7 @@
/**
@brief
The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
- !!! Don't forget to control the indexes of your check points and to set one last check point!!!
+ Don't forget to control the indexes of your check points and to set one last check point
*/
class _GametypesExport RaceCheckPoint : public DistanceMultiTrigger, public RadarViewable
{
@@ -82,10 +82,9 @@
{ return this; }
private:
- int bCheckpointIndex_; //The index of this check point. This value will be compared with the number of check points reached in the level. The check points must be indexed in ascending order beginning from zero and without any jumps between the indexes.
-
+ int bCheckpointIndex_; //The index of this check point.
Vector3 nextcheckpoints_; //the indexes of the next check points
- std::vector<RaceCheckPoint*> next_;
+
};
}
Modified: code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc 2011-12-14 13:15:45 UTC (rev 8978)
+++ code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.cc 2011-12-14 13:16:45 UTC (rev 8979)
@@ -50,10 +50,8 @@
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]=-1;} //TODO: should be removed; no functionallity
-
}
+
// void SpaceRace::SetConfigValues(){
//SUPER(Gametype,setConfigValues);
@@ -82,13 +80,12 @@
+ "." + multi_cast<std::string>(ms) + " seconds.";
const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
ChatManager::message(message);
-/*
+
float time = this->clock_.getSecondsPrecise();
this->scores_.insert(time);
std::set<float>::iterator it;
- for (it=this->scores_.begin(); it!=this->scores_.end(); it++)
- orxout(level::message) << multi_cast<std::string>(*it) << endl;
-*/
+
+
}
}
@@ -98,21 +95,11 @@
this->spawnPlayersIfRequested();
Gametype::checkStart();
this->cantMove_=true;
- //TODO: switch the engine off/on via a short function
+
for(ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
{
it->setActive(false);
- /*if(it->getMaxSpeedFront()>0)
- {
- this->maxSpeedBack_=it->getMaxSpeedBack();
- this->maxSpeedFront_=it->getMaxSpeedFront();
- this->maxSpeedLeftRight_=it->getMaxSpeedLeftRight();
- this->maxSpeedUpDown_=(it->getMaxSpeedUpDown());
- }
- it->setMaxSpeedBack(0);
- it->setMaxSpeedFront(0);
- it->setMaxSpeedLeftRight(0);
- it->setMaxSpeedUpDown(0);*/
+
}
this->addBots(this->numberOfBots_);
}
@@ -126,10 +113,7 @@
for(ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it)
{
it->setActive(true);
- /*it->setMaxSpeedBack(this->maxSpeedBack_);
- it->setMaxSpeedFront(this->maxSpeedFront_);
- it->setMaxSpeedLeftRight(this->maxSpeedLeftRight_);
- it->setMaxSpeedUpDown(this->maxSpeedUpDown_);*/
+
}
this->cantMove_= false;
Modified: code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h 2011-12-14 13:15:45 UTC (rev 8978)
+++ code/branches/spaceraceTwo/src/modules/gametypes/SpaceRace.h 2011-12-14 13:16:45 UTC (rev 8979)
@@ -39,8 +39,6 @@
#include "gametypes/Gametype.h"
-
-
#include "SpaceRaceManager.h"
namespace orxonox
@@ -52,7 +50,7 @@
class _GametypesExport SpaceRace : public Gametype
{
friend class RaceCheckPoint;
- //friend class SpaceRaceManager;
+
public:
SpaceRace(BaseObject* creator);
@@ -84,7 +82,6 @@
virtual void playerEntered(PlayerInfo* player); //!< Initializes values.
virtual bool playerLeft(PlayerInfo* player); //!< Manages all local variables.
private:
- float maxSpeedBack_; float maxSpeedFront_; float maxSpeedLeftRight_; float maxSpeedUpDown_;
bool cantMove_;
std::map<PlayerInfo*, int>checkpointReached_; //The number of the last check point reached by each player.
std::set<float> scores_; //The times of the players are saved in a set.
Modified: code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc
===================================================================
--- code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc 2011-12-14 13:15:45 UTC (rev 8978)
+++ code/branches/spaceraceTwo/src/modules/gametypes/SpaceRaceManager.cc 2011-12-14 13:16:45 UTC (rev 8979)
@@ -85,7 +85,7 @@
{
SUPER(SpaceRaceManager, XMLPort, xmlelement, mode);
- //XMLPortParam(WaypointController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
+
XMLPortObject(SpaceRaceManager, RaceCheckPoint, "checkpoints", addCheckpoint, getCheckpoint, xmlelement, mode);
}
@@ -154,6 +154,7 @@
else
{
if (index > -1)this->setRadVis(player,false);
+ else this->getCheckpoint(0)->setRadarVisibility(false);
gametype->newCheckpointReached(check,player);
check->setRadarObjectColour(ColourValue::Green); //sets the radar colour of the checkpoint to green if it is reached, else it is red.
More information about the Orxonox-commit
mailing list