[Orxonox-commit 5471] r10134 - in code/branches/towerdefenseHS14: data/levels data/levels/templates src/modules/towerdefense

erbj at orxonox.net erbj at orxonox.net
Wed Nov 26 15:58:48 CET 2014


Author: erbj
Date: 2014-11-26 15:58:47 +0100 (Wed, 26 Nov 2014)
New Revision: 10134

Added:
   code/branches/towerdefenseHS14/data/levels/templates/enemytowerdefense.oxt
Removed:
   code/branches/towerdefenseHS14/data/levels/templates/enemyTowerdefense.oxt
Modified:
   code/branches/towerdefenseHS14/data/levels/towerDefense.oxw
   code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc
   code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.h
   code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.cc
Log:
different models with style

Deleted: code/branches/towerdefenseHS14/data/levels/templates/enemyTowerdefense.oxt
===================================================================
--- code/branches/towerdefenseHS14/data/levels/templates/enemyTowerdefense.oxt	2014-11-19 15:27:48 UTC (rev 10133)
+++ code/branches/towerdefenseHS14/data/levels/templates/enemyTowerdefense.oxt	2014-11-26 14:58:47 UTC (rev 10134)
@@ -1,77 +0,0 @@
-<Template name=enemytowerdefense>
-  <TowerDefenseEnemy
-   hudtemplate            = spaceshiphud
-   camerapositiontemplate = spaceshipassffcameras
-   spawnparticlesource    = "Orxonox/fairytwirl"
-   spawnparticleduration  = 3
-   explosionchunks        = 6
-
-   health            = 100
-   maxhealth         = 200
-   initialhealth     = 100
-
-   shieldhealth        = 30
-   initialshieldhealth = 30
-   maxshieldhealth     = 50
-   shieldabsorption    = 0.8
-   reloadrate          = 1
-   reloadwaittime      = 1
-
-   primaryThrust     = 100
-   auxilaryThrust    = 30
-   rotationThrust    = 50
-
-   lift = 1;
-   stallSpeed = 220;
-
-   boostPower            = 15
-   boostPowerRate        = 1
-   boostRate             = 5
-   boostCooldownDuration = 10
-
-   shakeFrequency = 15
-   shakeAmplitude = 9
-
-   collisionType     = "dynamic"
-   mass              = 100
-   linearDamping     = 0.7
-   angularDamping    = 0.9999999
-
-   explosionSound = "sounds/Explosion2.ogg"
-  >
-
-    <engines>
-      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
-      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipassffengine />
-    </engines>
-    <attached>
-      <Model position="0,0,0" yaw=90 pitch=90 roll=0 scale=4 mesh="assff.mesh" />
-      <BlinkingBillboard position="17,-1.5,0" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=0.5 quadratic=1 />
-      <BlinkingBillboard position="-17,-1.5,0" material="Examples/Flare" colour="0.5, 1.0, 0.3" amplitude=0.1 frequency=0.5 phase=180 quadratic=1 />
-    </attached>
-    <collisionShapes>
-      <BoxCollisionShape position="0,0,0"      halfExtents="10, 3, 5" />
-      <BoxCollisionShape position="13,-1.3,0"  halfExtents="3, 1, 2" />
-      <BoxCollisionShape position="-13,-1.3,0" halfExtents="3, 1, 2" />
-      <BoxCollisionShape position="0,0,7"      halfExtents="3, 2, 2" />
-      <BoxCollisionShape position="0,0.1,-11"  halfExtents="2.2, 1.8, 6" />
-      <BoxCollisionShape position="0,0.1,-19"  halfExtents="1.4, 1, 2" />
-    </collisionShapes>
-    <controller>
-        <WaypointController accuracy=60>
-          <waypoints>
-            <!-- 1,3 10,3 10,11, 13,11 -->
-            
-            <Model  position="-700,-500, 150" />
-            <Model  position=" 200,-500, 150" />
-           
-            <Model  position=" 200, 300, 150" />
-            <Model  position=" 500, 300, 150" />
-          <!--  <Model mesh="cube.mesh" scale=10 position=" 500, 700, 150" /> -->
-            <Model  position=" 500, 700, 150" /> 
-            
-          </waypoints>
-        </WaypointController>
-      </controller>
-  </TowerDefenseEnemy>
-</Template>
\ No newline at end of file

Added: code/branches/towerdefenseHS14/data/levels/templates/enemytowerdefense.oxt
===================================================================
--- code/branches/towerdefenseHS14/data/levels/templates/enemytowerdefense.oxt	                        (rev 0)
+++ code/branches/towerdefenseHS14/data/levels/templates/enemytowerdefense.oxt	2014-11-26 14:58:47 UTC (rev 10134)
@@ -0,0 +1,234 @@
+<Template name=enemytowerdefense1>
+  <TowerDefenseEnemy
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipassffcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 100
+   maxhealth         = 200
+   initialhealth     = 100
+
+   shieldhealth        = 30
+   initialshieldhealth = 30
+   maxshieldhealth     = 50
+   shieldabsorption    = 0.8
+   reloadrate          = 1
+   reloadwaittime      = 1
+
+   primaryThrust     = 100
+   auxilaryThrust    = 30
+   rotationThrust    = 50
+
+   lift = 1;
+   stallSpeed = 220;
+
+   boostPower            = 15
+   boostPowerRate        = 1
+   boostRate             = 5
+   boostCooldownDuration = 10
+
+   shakeFrequency = 15
+   shakeAmplitude = 9
+
+   collisionType     = "dynamic"
+   mass              = 100
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+
+   explosionSound = "sounds/Explosion2.ogg"
+  >
+
+    <engines>
+      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipassffengine />
+    </engines>
+    <attached>
+      <Model position="0,0,0" yaw=90 pitch=90 roll=0 scale=4 mesh="assff.mesh" />
+      <BlinkingBillboard position="17,-1.5,0" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=0.5 quadratic=1 />
+      <BlinkingBillboard position="-17,-1.5,0" material="Examples/Flare" colour="0.5, 1.0, 0.3" amplitude=0.1 frequency=0.5 phase=180 quadratic=1 />
+    </attached>
+    <collisionShapes>
+      <BoxCollisionShape position="0,0,0"      halfExtents="10, 3, 5" />
+      <BoxCollisionShape position="13,-1.3,0"  halfExtents="3, 1, 2" />
+      <BoxCollisionShape position="-13,-1.3,0" halfExtents="3, 1, 2" />
+      <BoxCollisionShape position="0,0,7"      halfExtents="3, 2, 2" />
+      <BoxCollisionShape position="0,0.1,-11"  halfExtents="2.2, 1.8, 6" />
+      <BoxCollisionShape position="0,0.1,-19"  halfExtents="1.4, 1, 2" />
+    </collisionShapes>
+    <controller>
+        <WaypointController accuracy=60>
+          <waypoints>
+            <!-- 1,3 10,3 10,11, 13,11 -->
+            
+            <Model  position="-700,-500, 150" />
+            <Model  position=" 200,-500, 150" />
+           
+            <Model  position=" 200, 300, 150" />
+            <Model  position=" 500, 300, 150" />
+          <!--  <Model mesh="cube.mesh" scale=10 position=" 500, 700, 150" /> -->
+            <Model  position=" 500, 700, 150" /> 
+            
+          </waypoints>
+        </WaypointController>
+      </controller>
+  </TowerDefenseEnemy>
+</Template>
+
+
+<Template name=enemytowerdefense2>
+  <TowerDefenseEnemy
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipassffcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 100
+   maxhealth         = 200
+   initialhealth     = 100
+
+   shieldhealth        = 30
+   initialshieldhealth = 30
+   maxshieldhealth     = 50
+   shieldabsorption    = 0.8
+   reloadrate          = 1
+   reloadwaittime      = 1
+
+   primaryThrust     = 100
+   auxilaryThrust    = 30
+   rotationThrust    = 50
+
+   lift = 1;
+   stallSpeed = 220;
+
+   boostPower            = 15
+   boostPowerRate        = 1
+   boostRate             = 5
+   boostCooldownDuration = 10
+
+   shakeFrequency = 15
+   shakeAmplitude = 9
+
+   collisionType     = "dynamic"
+   mass              = 100
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+
+   explosionSound = "sounds/Explosion2.ogg"
+  >
+
+    <engines>
+      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipassffengine />
+    </engines>
+    <attached>
+      <Model position="0,0,0" yaw=90 pitch=90 roll=0 scale=4 mesh="JumpEnemy3.mesh" />
+      <BlinkingBillboard position="17,-1.5,0" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=0.5 quadratic=1 />
+      <BlinkingBillboard position="-17,-1.5,0" material="Examples/Flare" colour="0.5, 1.0, 0.3" amplitude=0.1 frequency=0.5 phase=180 quadratic=1 />
+    </attached>
+    <collisionShapes>
+      <BoxCollisionShape position="0,0,0"      halfExtents="10, 3, 5" />
+      <BoxCollisionShape position="13,-1.3,0"  halfExtents="3, 1, 2" />
+      <BoxCollisionShape position="-13,-1.3,0" halfExtents="3, 1, 2" />
+      <BoxCollisionShape position="0,0,7"      halfExtents="3, 2, 2" />
+      <BoxCollisionShape position="0,0.1,-11"  halfExtents="2.2, 1.8, 6" />
+      <BoxCollisionShape position="0,0.1,-19"  halfExtents="1.4, 1, 2" />
+    </collisionShapes>
+    <controller>
+        <WaypointController accuracy=60>
+          <waypoints>
+            <!-- 1,3 10,3 10,11, 13,11 -->
+            
+            <Model  position="-700,-500, 150" />
+            <Model  position=" 200,-500, 150" />
+           
+            <Model  position=" 200, 300, 150" />
+            <Model  position=" 500, 300, 150" />
+          <!--  <Model mesh="cube.mesh" scale=10 position=" 500, 700, 150" /> -->
+            <Model  position=" 500, 700, 150" /> 
+            
+          </waypoints>
+        </WaypointController>
+      </controller>
+  </TowerDefenseEnemy>
+</Template>
+
+<Template name=enemytowerdefense3>
+  <TowerDefenseEnemy
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipassffcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 6
+
+   health            = 100
+   maxhealth         = 200
+   initialhealth     = 100
+
+   shieldhealth        = 30
+   initialshieldhealth = 30
+   maxshieldhealth     = 50
+   shieldabsorption    = 0.8
+   reloadrate          = 1
+   reloadwaittime      = 1
+
+   primaryThrust     = 100
+   auxilaryThrust    = 30
+   rotationThrust    = 50
+
+   lift = 1;
+   stallSpeed = 220;
+
+   boostPower            = 15
+   boostPowerRate        = 1
+   boostRate             = 5
+   boostCooldownDuration = 10
+
+   shakeFrequency = 15
+   shakeAmplitude = 9
+
+   collisionType     = "dynamic"
+   mass              = 100
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+
+   explosionSound = "sounds/Explosion2.ogg"
+  >
+
+    <engines>
+      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipassffengine />
+    </engines>
+    <attached>
+      <Model position="0,0,0" yaw=90 pitch=90 roll=0 scale=4 mesh="JumpEnemy4.mesh" />
+      <BlinkingBillboard position="17,-1.5,0" material="Examples/Flare" colour="1.0, 0.5, 0.3" amplitude=0.1 frequency=0.5 quadratic=1 />
+      <BlinkingBillboard position="-17,-1.5,0" material="Examples/Flare" colour="0.5, 1.0, 0.3" amplitude=0.1 frequency=0.5 phase=180 quadratic=1 />
+    </attached>
+    <collisionShapes>
+      <BoxCollisionShape position="0,0,0"      halfExtents="10, 3, 5" />
+      <BoxCollisionShape position="13,-1.3,0"  halfExtents="3, 1, 2" />
+      <BoxCollisionShape position="-13,-1.3,0" halfExtents="3, 1, 2" />
+      <BoxCollisionShape position="0,0,7"      halfExtents="3, 2, 2" />
+      <BoxCollisionShape position="0,0.1,-11"  halfExtents="2.2, 1.8, 6" />
+      <BoxCollisionShape position="0,0.1,-19"  halfExtents="1.4, 1, 2" />
+    </collisionShapes>
+    <controller>
+        <WaypointController accuracy=60>
+          <waypoints>
+            <!-- 1,3 10,3 10,11, 13,11 -->
+            
+            <Model  position="-700,-500, 150" />
+            <Model  position=" 200,-500, 150" />
+           
+            <Model  position=" 200, 300, 150" />
+            <Model  position=" 500, 300, 150" />
+          <!--  <Model mesh="cube.mesh" scale=10 position=" 500, 700, 150" /> -->
+            <Model  position=" 500, 700, 150" /> 
+            
+          </waypoints>
+        </WaypointController>
+      </controller>
+  </TowerDefenseEnemy>
+</Template>
\ No newline at end of file

Modified: code/branches/towerdefenseHS14/data/levels/towerDefense.oxw
===================================================================
--- code/branches/towerdefenseHS14/data/levels/towerDefense.oxw	2014-11-19 15:27:48 UTC (rev 10133)
+++ code/branches/towerdefenseHS14/data/levels/towerDefense.oxw	2014-11-26 14:58:47 UTC (rev 10134)
@@ -20,7 +20,7 @@
   include("templates/spaceshipAssff.oxt")
   include("templates/spaceshipPirate.oxt")
   include("templates/tower.oxt")
-  include("templates/enemyTowerdefense.oxt")
+  include("templates/enemytowerdefense.oxt")
 ?>
 
 <!-- Specify the position of the camera -->

Modified: code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc	2014-11-19 15:27:48 UTC (rev 10133)
+++ code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc	2014-11-26 14:58:47 UTC (rev 10134)
@@ -157,11 +157,26 @@
 
     // Generates a TowerDefenseEnemy. Uses Template "enemytowerdefense". Sets position at first waypoint of path.
 
-    void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate*> path){
+    void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr){
 
     	TowerDefenseEnemy* en1 = new TowerDefenseEnemy(this->center_->getContext());
-        en1->addTemplate("enemytowerdefense");
-        en1->setScale(3);
+
+    	switch(templatenr)
+    	{
+    	case 1 :
+    		en1->addTemplate("enemytowerdefense1");
+            en1->setScale(3);
+    		break;
+    	case 2 :
+			en1->addTemplate("enemytowerdefense2");
+	        en1->setScale(2);
+			break;
+    	case 3 :
+			en1->addTemplate("enemytowerdefense3");
+	        en1->setScale(1);
+			break;
+    	}
+
         en1->getController();
 
         en1->setPosition(path.at(0)->get3dcoordinate());
@@ -282,7 +297,8 @@
 
             if(time>1 && TowerDefenseEnemyvector.size() < 30)
             {
-            	addTowerDefenseEnemy(path);
+
+            	addTowerDefenseEnemy(path, rand() %3 +1 );
             	time = time-1;
             }
 

Modified: code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.h
===================================================================
--- code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.h	2014-11-19 15:27:48 UTC (rev 10133)
+++ code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.h	2014-11-26 14:58:47 UTC (rev 10134)
@@ -55,7 +55,7 @@
 
         std::vector<TowerDefenseEnemy*> TowerDefenseEnemyvector;
 
-        void addTowerDefenseEnemy(std::vector<TDCoordinate*> path);
+        void addTowerDefenseEnemy(std::vector<TDCoordinate*> path, int templatenr);
         virtual void start(); //<! The function is called when the gametype starts
         virtual void end();
         virtual void tick(float dt);

Modified: code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.cc
===================================================================
--- code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.cc	2014-11-19 15:27:48 UTC (rev 10133)
+++ code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefenseEnemy.cc	2014-11-26 14:58:47 UTC (rev 10134)
@@ -47,9 +47,7 @@
 
         float distance = ship.distance(*endpoint);
 
-        orxout() << "distance" << distance << endl;
         if(distance <50){
-        	orxout() << "ENEMY KILLED!!!!" << endl;
         	this->destroy(); }
     }
 




More information about the Orxonox-commit mailing list