[Orxonox-commit 3956] r8630 - in code/branches/spacerace: data/levels src/modules/gametypes
dafrick at orxonox.net
dafrick at orxonox.net
Fri May 27 23:01:25 CEST 2011
Author: dafrick
Date: 2011-05-27 23:01:24 +0200 (Fri, 27 May 2011)
New Revision: 8630
Modified:
code/branches/spacerace/data/levels/spaceRace.oxw
code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.cc
code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.h
code/branches/spacerace/src/modules/gametypes/SpaceRace.cc
code/branches/spacerace/src/modules/gametypes/SpaceRace.h
Log:
Cleanup.
Modified: code/branches/spacerace/data/levels/spaceRace.oxw
===================================================================
--- code/branches/spacerace/data/levels/spaceRace.oxw 2011-05-27 20:59:15 UTC (rev 8629)
+++ code/branches/spacerace/data/levels/spaceRace.oxw 2011-05-27 21:01:24 UTC (rev 8630)
@@ -60,303 +60,303 @@
<!-- ------------------CheckPoints----------------- -->
<RaceCheckPoint name="checkpoint1" position="0,-2000,1000" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false">
<attached>
- <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
</attached>
<collisionShapes>
- <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
- <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
</collisionShapes>
</RaceCheckPoint>
<RaceCheckPoint name="checkpoint2" position="0,-900,2300" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="1" islast="false">
- <attached>
- <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
- <SpawnPoint position="0,0,0" lookat="0,1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
- <events>
- <activity>
- <Trigger mode="xor" invert="true" >
- <EventTrigger>
- <events>
- <trigger>
- <EventListener event="checkpoint2" />
- </trigger>
- </events>
- </EventTrigger>
- <EventTrigger invert="true">
- <events>
- <trigger>
- <EventListener event="checkpoint3" />
- </trigger>
- </events>
- </EventTrigger>
- </Trigger>
- </activity>
- </events>
- </SpawnPoint>
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
- <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
- </collisionShapes>
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ <SpawnPoint position="0,0,0" lookat="0,1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+ <events>
+ <activity>
+ <Trigger mode="xor" invert="true" >
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="checkpoint2" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert="true">
+ <events>
+ <trigger>
+ <EventListener event="checkpoint3" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </activity>
+ </events>
+ </SpawnPoint>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
</RaceCheckPoint>
<RaceCheckPoint name="checkpoint3" position="0,700,2700" stayActive="true" direction="0,0,1" collisionType="static" scale="1" distance="40" checkpointindex="2" islast="false">
- <attached>
- <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
- <SpawnPoint position="0,0,0" lookat="0,1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
- <events>
- <activity>
- <Trigger mode="xor" invert="true" >
- <EventTrigger>
- <events>
- <trigger>
- <EventListener event="checkpoint3" />
- </trigger>
- </events>
- </EventTrigger>
- <EventTrigger invert="true">
- <events>
- <trigger>
- <EventListener event="checkpoint4" />
- </trigger>
- </events>
- </EventTrigger>
- </Trigger>
- </activity>
- </events>
- </SpawnPoint>
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
- <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
- </collisionShapes>
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ <SpawnPoint position="0,0,0" lookat="0,1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+ <events>
+ <activity>
+ <Trigger mode="xor" invert="true" >
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="checkpoint3" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert="true">
+ <events>
+ <trigger>
+ <EventListener event="checkpoint4" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </activity>
+ </events>
+ </SpawnPoint>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
</RaceCheckPoint>
<RaceCheckPoint name="checkpoint4" position="0,2100,2300" stayActive="true" direction="0,1,1" collisionType="static" scale="1" distance="40" checkpointindex="3" islast="false">
- <attached>
- <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
- <DistanceTrigger name="trigger3" position="0,0,0" distance=40 stayActive="true" />
- <SpawnPoint position="0,0,0" lookat="0,-1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
- <events>
- <activity>
- <Trigger mode="xor" invert="true" >
- <EventTrigger>
- <events>
- <trigger>
- <EventListener event="checkpoint4" />
- </trigger>
- </events>
- </EventTrigger>
- <EventTrigger invert="true">
- <events>
- <trigger>
- <EventListener event="checkpoint5" />
- </trigger>
- </events>
- </EventTrigger>
- </Trigger>
- </activity>
- </events>
- </SpawnPoint>
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
- <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
- </collisionShapes>
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ <DistanceTrigger name="trigger3" position="0,0,0" distance=40 stayActive="true" />
+ <SpawnPoint position="0,0,0" lookat="0,-1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+ <events>
+ <activity>
+ <Trigger mode="xor" invert="true" >
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="checkpoint4" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert="true">
+ <events>
+ <trigger>
+ <EventListener event="checkpoint5" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </activity>
+ </events>
+ </SpawnPoint>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
</RaceCheckPoint>
<RaceCheckPoint name="checkpoint5" position="0,2200,500" stayActive="true" direction="0,1,0" collisionType="static" scale="1" distance="40" checkpointindex="4" islast="false">
- <attached>
- <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
- <DistanceTrigger name="trigger4" position="0,0,0" distance=40 stayActive="true" />
- <SpawnPoint position="0,0,0" lookat="0,-1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
- <events>
- <activity>
- <Trigger mode="xor" invert="true" >
- <EventTrigger>
- <events>
- <trigger>
- <EventListener event="checkpoint5" />
- </trigger>
- </events>
- </EventTrigger>
- <EventTrigger invert="true">
- <events>
- <trigger>
- <EventListener event="checkpoint6" />
- </trigger>
- </events>
- </EventTrigger>
- </Trigger>
- </activity>
- </events>
- </SpawnPoint>
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
- <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
- </collisionShapes>
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ <DistanceTrigger name="trigger4" position="0,0,0" distance=40 stayActive="true" />
+ <SpawnPoint position="0,0,0" lookat="0,-1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+ <events>
+ <activity>
+ <Trigger mode="xor" invert="true" >
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="checkpoint5" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert="true">
+ <events>
+ <trigger>
+ <EventListener event="checkpoint6" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </activity>
+ </events>
+ </SpawnPoint>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
</RaceCheckPoint>
<RaceCheckPoint name="checkpoint6" position="0,1500,-800" stayActive="true" direction="0,1,-1" collisionType="static" scale="1" distance="40" checkpointindex="5" islast="false">
- <attached>
- <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
- <DistanceTrigger name="trigger5" position="0,0,0" distance=40 stayActive="true" />
- <SpawnPoint position="0,0,0" lookat="0,-1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
- <events>
- <activity>
- <Trigger mode="xor" invert="true" >
- <EventTrigger>
- <events>
- <trigger>
- <EventListener event="checkpoint6" />
- </trigger>
- </events>
- </EventTrigger>
- <EventTrigger invert="true">
- <events>
- <trigger>
- <EventListener event="checkpoint7" />
- </trigger>
- </events>
- </EventTrigger>
- </Trigger>
- </activity>
- </events>
- </SpawnPoint>
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
- <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
- </collisionShapes>
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ <DistanceTrigger name="trigger5" position="0,0,0" distance=40 stayActive="true" />
+ <SpawnPoint position="0,0,0" lookat="0,-1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+ <events>
+ <activity>
+ <Trigger mode="xor" invert="true" >
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="checkpoint6" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert="true">
+ <events>
+ <trigger>
+ <EventListener event="checkpoint7" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </activity>
+ </events>
+ </SpawnPoint>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
</RaceCheckPoint>
<RaceCheckPoint name="checkpoint7" position="0,200,-1900" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="6" islast="false">
- <attached>
- <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
- <DistanceTrigger name="trigger6" position="0,0,0" distance=40 stayActive="true" />
- <SpawnPoint position="0,0,0" lookat="0,-1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
- <events>
- <activity>
- <Trigger mode="xor" invert="true" >
- <EventTrigger>
- <events>
- <trigger>
- <EventListener event="checkpoint7" />
- </trigger>
- </events>
- </EventTrigger>
- <EventTrigger invert="true">
- <events>
- <trigger>
- <EventListener event="checkpoint8" />
- </trigger>
- </events>
- </EventTrigger>
- </Trigger>
- </activity>
- </events>
- </SpawnPoint>
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
- <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
- </collisionShapes>
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ <DistanceTrigger name="trigger6" position="0,0,0" distance=40 stayActive="true" />
+ <SpawnPoint position="0,0,0" lookat="0,-1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+ <events>
+ <activity>
+ <Trigger mode="xor" invert="true" >
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="checkpoint7" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert="true">
+ <events>
+ <trigger>
+ <EventListener event="checkpoint8" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </activity>
+ </events>
+ </SpawnPoint>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
</RaceCheckPoint>
<RaceCheckPoint name="checkpoint8" position="0,-700,-1400" stayActive="true" direction="0,-1,-1" collisionType="static" scale="1" distance="40" checkpointindex="7" islast="false">
- <attached>
- <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
- <DistanceTrigger name="trigger7" position="0,0,0" distance=40 stayActive="true" />
- <SpawnPoint position="0,0,0" lookat="0,-1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
- <events>
- <activity>
- <Trigger mode="xor" invert="true" >
- <EventTrigger>
- <events>
- <trigger>
- <EventListener event="checkpoint8" />
- </trigger>
- </events>
- </EventTrigger>
- <EventTrigger invert="true">
- <events>
- <trigger>
- <EventListener event="checkpoint9" />
- </trigger>
- </events>
- </EventTrigger>
- </Trigger>
- </activity>
- </events>
- </SpawnPoint>
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
- <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
- </collisionShapes>
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ <DistanceTrigger name="trigger7" position="0,0,0" distance=40 stayActive="true" />
+ <SpawnPoint position="0,0,0" lookat="0,-1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
+ <events>
+ <activity>
+ <Trigger mode="xor" invert="true" >
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="checkpoint8" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert="true">
+ <events>
+ <trigger>
+ <EventListener event="checkpoint9" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </activity>
+ </events>
+ </SpawnPoint>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
</RaceCheckPoint>
<RaceCheckPoint name="checkpoint9" position="0,-1300,-800" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="8" islast="false">
- <attached>
- <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
- <DistanceTrigger name="trigger8" position="0,0,0" distance=40 stayActive="true" />
- <SpawnPoint position="0,0,0" lookat="0,-1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
- <events>
- <activity>
- <EventTrigger>
+ <attached>
+ <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ <DistanceTrigger name="trigger8" position="0,0,0" distance=40 stayActive="true" />
+ <SpawnPoint position="0,0,0" lookat="0,-1000,0" spawnclass=SpaceShip pawndesign=spaceshipassff active="false" >
<events>
- <trigger>
- <EventListener event="checkpoint9" />
- </trigger>
+ <activity>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="checkpoint9" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </activity>
</events>
- </EventTrigger>
- </activity>
- </events>
- </SpawnPoint>
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
- <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
- </collisionShapes>
+ </SpawnPoint>
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
</RaceCheckPoint>
<RaceCheckPoint name="checkpoint10" position="0,-2100,0" collisionType="static" scale="1" distance="40" checkpointindex="9" islast="true" timelimit="150">
- <attached>
- <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
- <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
- <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
- </collisionShapes>
+ <attached>
+ < Model mass="50" scale="50" mesh="raceCheckPoint.mesh" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" />
+ <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" />
+ <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" />
+ </collisionShapes>
</RaceCheckPoint>
<!-- ------------------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>
+ <collisionShapes>
+ <SphereCollisionShape radius="399" />
+ </collisionShapes>
</StaticEntity>
<!-- ---------------asteroid ellypse----------------- -->
@@ -364,7 +364,7 @@
max = 20
for i = 0, max, 1
do
- y = math.sin(i/max*6)*2000
+ y = math.sin(i/max*6)*2000
z = math.cos(i/max*6)*2500
x = 0
?>
@@ -384,10 +384,10 @@
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----- -->
+ <?lua if k == 5 then ?><attached><!-- ---------asteroid fog----- -->
<ParticleEmitter position="0,0,0" source="Orxonox/Steam" />
</attached> <?lua end ?>
- </Model>
+ </Model>
</attached>
<collisionShapes>
<SphereCollisionShape radius="<?lua print(j * 80) ?>" />
@@ -450,9 +450,9 @@
</templates>
<controller>
<WaypointPatrolController alertnessradius=1500 team=0 >
- <waypoints>
- <Model scale=0 position="0,2000,2000" />
- </waypoints>
+ <waypoints>
+ <Model scale=0 position="0,2000,2000" />
+ </waypoints>
</WaypointPatrolController>
</controller>
</SpaceShip>
@@ -462,11 +462,11 @@
<Template link=spaceshipassff />
</templates>
<controller>
- <WaypointPatrolController alertnessradius=1500 team=0 >
- <waypoints>
- <Model scale=0 position="0,2000,-2000" />
- </waypoints>
- </WaypointPatrolController>
+ <WaypointPatrolController alertnessradius=1500 team=0 >
+ <waypoints>
+ <Model scale=0 position="0,2000,-2000" />
+ </waypoints>
+ </WaypointPatrolController>
</controller>
</SpaceShip>
Modified: code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.cc
===================================================================
--- code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.cc 2011-05-27 20:59:15 UTC (rev 8629)
+++ code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.cc 2011-05-27 21:01:24 UTC (rev 8630)
@@ -37,17 +37,15 @@
{
CreateFactory(RaceCheckPoint);
- RaceCheckPoint::RaceCheckPoint(BaseObject* creator):
- DistanceTrigger(creator),
- RadarViewable(creator, static_cast<WorldEntity*>(this))
+ RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))
{
- RegisterObject(RaceCheckPoint);
-
- this->bCheckpointIndex_ = 0;
- this->bIsLast_ = false;
- this->bTimeLimit_ = 0;
-
- this->setRadarObjectColour(ColourValue::Blue);
+ RegisterObject(RaceCheckPoint);
+
+ this->bCheckpointIndex_ = 0;
+ this->bIsLast_ = false;
+ this->bTimeLimit_ = 0;
+
+ this->setRadarObjectColour(ColourValue::Blue);
this->setRadarObjectShape(RadarViewable::Triangle);
this->setRadarVisibility(false);
}
@@ -58,65 +56,63 @@
void RaceCheckPoint::tick(float dt)
{
- Trigger::tick(dt);
-
- SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
- if (this->getCheckpointIndex() == gametype->getCheckpointsReached()) this->setRadarVisibility(true);
- else this->setRadarVisibility(false);
+ SUPER(RaceCheckPoint, tick, dt);
+
+ SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
+ if (this->getCheckpointIndex() == gametype->getCheckpointsReached())
+ this->setRadarVisibility(true);
+ else
+ this->setRadarVisibility(false);
}
void RaceCheckPoint::XMLPort(Element& xmlelement, XMLPort::Mode mode)
{
- SUPER(RaceCheckPoint, XMLPort, xmlelement, mode);
-
- XMLPortParam(RaceCheckPoint, "checkpointindex", setCheckpointIndex, getCheckpointIndex, xmlelement, mode).defaultValues(0);
- XMLPortParam(RaceCheckPoint, "islast", setLast, getLast, xmlelement, mode).defaultValues(false);
- XMLPortParam(RaceCheckPoint, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0);
+ SUPER(RaceCheckPoint, XMLPort, xmlelement, mode);
+
+ XMLPortParam(RaceCheckPoint, "checkpointindex", setCheckpointIndex, getCheckpointIndex, xmlelement, mode).defaultValues(0);
+ XMLPortParam(RaceCheckPoint, "islast", setLast, getLast, xmlelement, mode).defaultValues(false);
+ XMLPortParam(RaceCheckPoint, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0);
}
void RaceCheckPoint::triggered(bool bIsTriggered)
{
- DistanceTrigger::triggered(bIsTriggered);
-
- SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
- if (gametype)
- {
- if (this->getCheckpointIndex() == gametype->getCheckpointsReached() && bIsTriggered)
- {
- gametype->clock_->capture();
- float time = gametype->clock_->getSecondsPrecise();
- if (this->bTimeLimit_!=0 && time > this->bTimeLimit_) {
- gametype->timeIsUp();
- gametype->end();
- }
- else if (this->getLast())
- {
- gametype->end();
- }
- else
- {
- gametype->newCheckpointReached();
- this->setRadarObjectColour(ColourValue::Green); //sets the radar colour of the checkpoint to green if it is reached, else it is red.
- }
- }
- }
+ DistanceTrigger::triggered(bIsTriggered);
+
+ SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
+ if (gametype && this->getCheckpointIndex() == gametype->getCheckpointsReached() && bIsTriggered)
+ {
+ gametype->clock_.capture();
+ float time = gametype->clock_.getSecondsPrecise();
+ if (this->bTimeLimit_!=0 && time > this->bTimeLimit_)
+ {
+ gametype->timeIsUp();
+ gametype->end();
+ }
+ else if (this->getLast())
+ gametype->end();
+ else
+ {
+ gametype->newCheckpointReached();
+ this->setRadarObjectColour(ColourValue::Green); //sets the radar colour of the checkpoint to green if it is reached, else it is red.
+ }
+ }
}
void RaceCheckPoint::setTimelimit(float timeLimit)
- {
- this->bTimeLimit_ = timeLimit;
- if (this->bTimeLimit_ != 0)
- {
- SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
- if (gametype)
- {
- const std::string& message = "\nYou have " + multi_cast<std::string>(this->bTimeLimit_)
- + " seconds to reach the check point " + multi_cast<std::string>(this->bCheckpointIndex_+1) + "\n\n";
- COUT(0) << message;
- const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage(message);
- }
- }
- }
+ {
+ this->bTimeLimit_ = timeLimit;
+ if (this->bTimeLimit_ != 0)
+ {
+ SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get());
+ if (gametype)
+ {
+ const std::string& message = "You have " + multi_cast<std::string>(this->bTimeLimit_)
+ + " seconds to reach the check point " + multi_cast<std::string>(this->bCheckpointIndex_+1) + "\n";
+ COUT(3) << message;
+ const_cast<GametypeInfo*>(gametype->getGametypeInfo())->sendAnnounceMessage(message);
+ }
+ }
+ }
}
Modified: code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.h
===================================================================
--- code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.h 2011-05-27 20:59:15 UTC (rev 8629)
+++ code/branches/spacerace/src/modules/gametypes/RaceCheckPoint.h 2011-05-27 21:01:24 UTC (rev 8630)
@@ -33,46 +33,46 @@
#include "objects/triggers/DistanceTrigger.h"
#include "interfaces/RadarViewable.h"
-#include <boost/concept_check.hpp>
+//#include <boost/concept_check.hpp>
namespace orxonox
{
/**
@brief
- The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level.
- !!! Don't forget to controll the indexes of your check points and to set one last check point!!!
+ 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!!!
*/
class _ObjectsExport RaceCheckPoint : public DistanceTrigger, public RadarViewable
{
- public:
- RaceCheckPoint(BaseObject* creator);
- virtual ~RaceCheckPoint();
-
- virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
- virtual void tick(float dt);
-
- protected:
- virtual void triggered(bool bIsTriggered);
- inline void setLast(bool isLast)
- { this->bIsLast_ = isLast; }
- inline bool getLast()
- { return this->bIsLast_; }
- inline void setCheckpointIndex(int checkpointIndex)
- { this->bCheckpointIndex_ = checkpointIndex; }
- inline int getCheckpointIndex()
- { return this->bCheckpointIndex_; }
- virtual void setTimelimit(float timeLimit);
- inline float getTimeLimit()
- { return this->bTimeLimit_;}
- inline const WorldEntity* getWorldEntity() const
- { 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.
- bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
- float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
+ public:
+ RaceCheckPoint(BaseObject* creator);
+ virtual ~RaceCheckPoint();
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void tick(float dt);
+
+ protected:
+ virtual void triggered(bool bIsTriggered);
+ inline void setLast(bool isLast)
+ { this->bIsLast_ = isLast; }
+ inline bool getLast()
+ { return this->bIsLast_; }
+ inline void setCheckpointIndex(int checkpointIndex)
+ { this->bCheckpointIndex_ = checkpointIndex; }
+ inline int getCheckpointIndex()
+ { return this->bCheckpointIndex_; }
+ virtual void setTimelimit(float timeLimit);
+ inline float getTimeLimit()
+ { return this->bTimeLimit_;}
+ inline const WorldEntity* getWorldEntity() const
+ { 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.
+ bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level.
+ float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses.
};
}
-#endif
\ No newline at end of file
+#endif /* _RaceCheckPoint_H__ */
\ No newline at end of file
Modified: code/branches/spacerace/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/branches/spacerace/src/modules/gametypes/SpaceRace.cc 2011-05-27 20:59:15 UTC (rev 8629)
+++ code/branches/spacerace/src/modules/gametypes/SpaceRace.cc 2011-05-27 21:01:24 UTC (rev 8630)
@@ -40,70 +40,67 @@
SpaceRace::SpaceRace(BaseObject* creator) : Gametype(creator)
{
- RegisterObject(SpaceRace);
- this->bCheckpointsReached_ = 0;
- this->bTimeIsUp_ = false;
- this->numberOfBots_ = 0;
+ RegisterObject(SpaceRace);
+ this->bCheckpointsReached_ = 0;
+ this->bTimeIsUp_ = false;
+ this->numberOfBots_ = 0;
}
- void SpaceRace::tick(float dt)
- {
- Gametype::tick(dt);
- }
-
void SpaceRace::end()
{
- Gametype::end();
- if (this->bTimeIsUp_) {
- this->clock_->capture();
- int s = this->clock_->getSeconds();
- int ms = this->clock_->getMilliseconds()-1000*s;
- const std::string& message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n"
- + "You didn't reach the check point " + multi_cast<std::string>(this->bCheckpointsReached_+1)
- + " before the time limit. You lose!\n";
- COUT(0) << message;
- const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
- Host::Broadcast(message);
- }
- else {
- this->clock_->capture();
- int s = this->clock_->getSeconds();
- int ms = this->clock_->getMilliseconds()-1000*s;
- const std::string& message = "You win!! You have reached the last check point after "+ multi_cast<std::string>(s)
- + "." + multi_cast<std::string>(ms) + " seconds.\n";
- COUT(0) << message << std::endl;
- const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
- Host::Broadcast(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++)
- COUT(0) << multi_cast<std::string>(*it) << std::endl;
- }
+ this->Gametype::end();
+
+ if (this->bTimeIsUp_)
+ {
+ this->clock_.capture();
+ int s = this->clock_.getSeconds();
+ int ms = this->clock_.getMilliseconds()-1000*s;
+ const std::string& message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n"
+ + "You didn't reach the check point " + multi_cast<std::string>(this->bCheckpointsReached_+1)
+ + " before the time limit. You lose!";
+ COUT(3) << message;
+ const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+ Host::Broadcast(message);
+ }
+ else
+ {
+ this->clock_.capture();
+ int s = this->clock_.getSeconds();
+ int ms = this->clock_.getMilliseconds()-1000*s;
+ const std::string& message = "You win!! You have reached the last check point after "+ multi_cast<std::string>(s)
+ + "." + multi_cast<std::string>(ms) + " seconds.";
+ COUT(3) << message << std::endl;
+ const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+ Host::Broadcast(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++)
+ COUT(3) << multi_cast<std::string>(*it) << std::endl;
+ }
}
void SpaceRace::start()
{
- Gametype::start();
-
- clock_= new Clock();
- std::string message("The match has started! Reach the check points as quickly as possible!");
- COUT(0) << message << std::endl;
+ Gametype::start();
+
+ std::string message("The match has started! Reach the check points as quickly as possible!");
+ COUT(3) << message << std::endl;
Host::Broadcast(message);
}
void SpaceRace::newCheckpointReached()
{
- this->bCheckpointsReached_++;
- this->clock_->capture();
- int s = this->clock_->getSeconds();
- int ms = this->clock_->getMilliseconds()-1000*s;
- const std::string& message = "Checkpoint " + multi_cast<std::string>(this->getCheckpointsReached())
- + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
- + " seconds.\n";
- COUT(0) << message << std::endl;
- const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
- Host::Broadcast(message);
+ this->bCheckpointsReached_++;
+ this->clock_.capture();
+ int s = this->clock_.getSeconds();
+ int ms = this->clock_.getMilliseconds()-1000*s;
+ const std::string& message = "Checkpoint " + multi_cast<std::string>(this->getCheckpointsReached())
+ + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms)
+ + " seconds.\n";
+ COUT(3) << message;
+ const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message);
+ Host::Broadcast(message);
}
}
\ No newline at end of file
Modified: code/branches/spacerace/src/modules/gametypes/SpaceRace.h
===================================================================
--- code/branches/spacerace/src/modules/gametypes/SpaceRace.h 2011-05-27 20:59:15 UTC (rev 8629)
+++ code/branches/spacerace/src/modules/gametypes/SpaceRace.h 2011-05-27 21:01:24 UTC (rev 8630)
@@ -41,35 +41,36 @@
{
/**
@brief
- The SpaceRace class enables the creation of a space race level, where the player has to reach check points in a given order.
+ The SpaceRace class enables the creation of a space race level, where the player has to reach check points in a given order.
*/
class _OrxonoxExport SpaceRace : public Gametype
{
- public:
- SpaceRace(BaseObject* creator);
- virtual ~SpaceRace() {}
-
- virtual void tick(float dt);
-
- virtual void start();
- virtual void end();
-
- virtual void newCheckpointReached();
-
- inline void setCheckpointsReached(int n)
- { this->bCheckpointsReached_ = n;}
- inline int getCheckpointsReached()
- { return this->bCheckpointsReached_; }
- inline void timeIsUp()
- { this->bTimeIsUp_ = true;}
- Clock *clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late.
- protected:
-
- private:
- int bCheckpointsReached_; //The current number of check points reached by the player.
- std::set<float> scores_; //The times of the players are saved in a set.
- bool bTimeIsUp_; //True if one of the check points is reached too late.
+ friend class RaceCheckPoint;
+
+ public:
+ SpaceRace(BaseObject* creator);
+ virtual ~SpaceRace() {}
+
+ virtual void start();
+ virtual void end();
+
+ virtual void newCheckpointReached();
+
+ inline void setCheckpointsReached(int n)
+ { this->bCheckpointsReached_ = n;}
+ inline int getCheckpointsReached()
+ { return this->bCheckpointsReached_; }
+ inline void timeIsUp()
+ { this->bTimeIsUp_ = true;}
+
+ protected:
+
+ private:
+ int bCheckpointsReached_; //The current number of check points reached by the player.
+ std::set<float> scores_; //The times of the players are saved in a set.
+ bool bTimeIsUp_; //True if one of the check points is reached too late.
+ Clock clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late.
};
}
-#endif
+#endif /* _SpaceRace_H__ */
More information about the Orxonox-commit
mailing list