[Orxonox-commit 7297] r11914 - in code/branches/OrxyRoad_FS18: data/levels/templates src/modules/orxyroad
jacobsr at orxonox.net
jacobsr at orxonox.net
Thu Apr 26 16:06:31 CEST 2018
Author: jacobsr
Date: 2018-04-26 16:06:31 +0200 (Thu, 26 Apr 2018)
New Revision: 11914
Modified:
code/branches/OrxyRoad_FS18/data/levels/templates/OrxyRoadPattern.oxt
code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoad.cc
Log:
experimental moving cubes
Modified: code/branches/OrxyRoad_FS18/data/levels/templates/OrxyRoadPattern.oxt
===================================================================
--- code/branches/OrxyRoad_FS18/data/levels/templates/OrxyRoadPattern.oxt 2018-04-26 14:05:17 UTC (rev 11913)
+++ code/branches/OrxyRoad_FS18/data/levels/templates/OrxyRoadPattern.oxt 2018-04-26 14:06:31 UTC (rev 11914)
@@ -58,4 +58,19 @@
</collisionShapes>
</OrxyRoadCube>
+</Template>
+
+<Template name=SingleOrxyRoadCube>
+
+ <OrxyRoadCube position="0,0,0" direction="0,0,0" scale="1" collisionType=dynamic mass=1 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="CuboidBody.mesh" scale3D="300,50,50" />
+
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="300,50,50" />
+
+ </collisionShapes>
+ </OrxyRoadCube>
+
</Template>
\ No newline at end of file
Modified: code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoad.cc
===================================================================
--- code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoad.cc 2018-04-26 14:05:17 UTC (rev 11913)
+++ code/branches/OrxyRoad_FS18/src/modules/orxyroad/OrxyRoad.cc 2018-04-26 14:06:31 UTC (rev 11914)
@@ -54,7 +54,7 @@
multiplier = 1;
b_combo = false;
counter = 5000;
- pattern = 1;
+ pattern = 3;
lastPosition = 0;
// spawn enemy every 3.5 seconds
//enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&OrxyRoad::spawnEnemy, this)));
@@ -111,34 +111,38 @@
if(counter >= 3000)
{
counter = 0;
- for(int i = 0; i<6; i++)
+ for(int j = 0; j < 3; j++)
{
- OrxyRoadCube* cube = new OrxyRoadCube(this->center_->getContext());
- cubeList.push_back(cube);
- switch(pattern)
+ for(int i = -30; i<30; i++)
{
- case 1: cube->addTemplate("OrxyRoadCube01");
- break;
- case 2: cube->addTemplate("OrxyRoadCube01");
- break;
+ OrxyRoadCube* cube = new OrxyRoadCube(this->center_->getContext());
+ cubeList.push_back(cube);
+ switch(pattern)
+ {
+ case 1: cube->addTemplate("OrxyRoadCube01");
+ break;
+ case 2: cube->addTemplate("OrxyRoadCube01");
+ break;
+ case 3: cube->addTemplate("SingleOrxyRoadCube");
- }
+ }
- cube->setPosition(player->getWorldPosition() + Vector3(5000.0f, 0.0f, -3600.0f + (i*1200)));
-
- /* experimental */
+ cube->setPosition(player->getWorldPosition() + Vector3(1000.0f+j*800.0f, 0.0f, i*600.0f+j*300));
+
+ /* experimental */
- //cube->setVelocity(10,0,0);
+ cube->setVelocity(0,0,500);
- /* experimental */
+ /* experimental */
- //stEntity->setScale3D(50,50,50);
+ //stEntity->setScale3D(50,50,50);
+ }
}
- pattern %= 2;
- pattern ++;
+ //pattern %= 2;
+ //pattern ++;
}
More information about the Orxonox-commit
mailing list