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

maxima at orxonox.net maxima at orxonox.net
Wed Nov 12 23:53:34 CET 2014


Author: maxima
Date: 2014-11-12 23:53:34 +0100 (Wed, 12 Nov 2014)
New Revision: 10125

Added:
   code/branches/towerdefenseHS14/data/levels/templates/enemyTowerdefense.oxt
Removed:
   code/branches/towerdefenseHS14/data/levels/templates/TowerdefenseEnemy.oxt
Modified:
   code/branches/towerdefenseHS14/data/levels/towerDefense.oxw
   code/branches/towerdefenseHS14/src/modules/towerdefense/TDCoordinate.cc
   code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc
Log:
Enemies use the new template enemytowerdefense

Deleted: code/branches/towerdefenseHS14/data/levels/templates/TowerdefenseEnemy.oxt
===================================================================
--- code/branches/towerdefenseHS14/data/levels/templates/TowerdefenseEnemy.oxt	2014-11-12 15:11:00 UTC (rev 10124)
+++ code/branches/towerdefenseHS14/data/levels/templates/TowerdefenseEnemy.oxt	2014-11-12 22:53:34 UTC (rev 10125)
@@ -1,84 +0,0 @@
-<Template name=TowerdefenseEnemy>
-  <TowerdefenseEnemy
-   hudtemplate            = spaceshiphud
-   camerapositiontemplate = TowerdefenseEnemycameras
-   spawnparticlesource    = "Orxonox/fairytwirl"
-   spawnparticleduration  = 3
-   explosionchunks        = 6
-
-   health            = 100
-   maxhealth         = 200
-   initialhealth     = 100
-
-   primaryThrust     = 100
-   auxilaryThrust    = 30
-   rotationThrust    = 50
-
-
-   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=TowerdefenseEnemyengine />
-      <MultiStateEngine position="-7.6, 0, 0" template=TowerdefenseEnemyengine />
-    </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" />
-  </TowerdefenseEnemy>
-</Template>
-
-<Template name=TowerdefenseEnemycameras defaults=0>
-  <TowerdefenseEnemy>
-    <camerapositions>
-      <CameraPosition position="0,10, 40" drag=true mouselook=true />
-      <CameraPosition position="0,20, 80" drag=true mouselook=true />
-      <CameraPosition position="0,30,120" drag=true mouselook=true />
-    </camerapositions>
-  </TowerdefenseEnemy>
-</Template>
-
-
-    <EffectContainer condition="idle">
-      <WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
-    </EffectContainer>
-    <EffectContainer condition="not idle">
-      <FadingBillboard mainstate=activity active=false scale=0.1 position="7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
-      <FadingBillboard mainstate=activity active=false scale=0.1 position="-7.6, 0, 9" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
-    </EffectContainer>
-    <EffectContainer condition="normal or brake">
-
-    </EffectContainer>
-    <EffectContainer condition="normal or boost">
-      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 7.6, 0, 6" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
-      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 6" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1500 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
-    </EffectContainer>
-    <EffectContainer condition="boost">
-      <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 7.6, 0, 6" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
-      <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-7.6, 0, 6" colour="0.6, 0.75, 0.8, 0.7" width=40 length=1000 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
-    </EffectContainer>
-<!--    <EffectContainer condition="brake">
-      <FadingBillboard mainstate=activity active=false scale=0.3 position=" 8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
-      <FadingBillboard mainstate=activity active=false scale=0.3 position="-8, 0, 6" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
-      <FadingBillboard mainstate=activity active=false scale=0.15 position=" 8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
-      <FadingBillboard mainstate=activity active=false scale=0.15 position="-8, 0, 6" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
-    </EffectContainer>
--->
-  </MultiStateEngine>
-</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-12 22:53:34 UTC (rev 10125)
@@ -0,0 +1,60 @@
+<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>
+  </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-12 15:11:00 UTC (rev 10124)
+++ code/branches/towerdefenseHS14/data/levels/towerDefense.oxw	2014-11-12 22:53:34 UTC (rev 10125)
@@ -20,6 +20,7 @@
   include("templates/spaceshipAssff.oxt")
   include("templates/spaceshipPirate.oxt")
   include("templates/tower.oxt")
+  include("templates/enemyTowerdefense.oxt")
 ?>
 
 <!-- Specify the position of the camera -->
@@ -77,7 +78,7 @@
 
     <SpaceShip position="-700,-500, 100" lookat="0,0,0" scale=3 team=1 >
       <templates>
-        <Template link=spaceshipassff />
+        <Template link=enemytowerdefense />
       </templates>
       <controller>
         <WaypointController accuracy=60>
@@ -131,10 +132,9 @@
     position="0,0,0"
     direction="0,0,0"
     collisionType=dynamic
-    mass=100000>
+    mass=100000
+    />
 
-    </TowerDefenseCenterpoint>
-
   </Scene>
 </Level>
 

Modified: code/branches/towerdefenseHS14/src/modules/towerdefense/TDCoordinate.cc
===================================================================
--- code/branches/towerdefenseHS14/src/modules/towerdefense/TDCoordinate.cc	2014-11-12 15:11:00 UTC (rev 10124)
+++ code/branches/towerdefenseHS14/src/modules/towerdefense/TDCoordinate.cc	2014-11-12 22:53:34 UTC (rev 10125)
@@ -35,7 +35,7 @@
     	Vector3 *coord = new Vector3();
     	coord->x= (x-8) * tileScale;
     	coord->y= (y-8) * tileScale;
-    	coord->z=0;
+    	coord->z=100;
 
     	return *coord;
     }

Modified: code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc
===================================================================
--- code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc	2014-11-12 15:11:00 UTC (rev 10124)
+++ code/branches/towerdefenseHS14/src/modules/towerdefense/TowerDefense.cc	2014-11-12 22:53:34 UTC (rev 10125)
@@ -147,8 +147,8 @@
         //add some TowerDefenseEnemys
 
         TDCoordinate* coord1 = new TDCoordinate(1,1);
-        TDCoordinate* coord2 = new TDCoordinate(1,1);
-        TDCoordinate* coord3 = new TDCoordinate(1,2);
+        TDCoordinate* coord2 = new TDCoordinate(1,3);
+        TDCoordinate* coord3 = new TDCoordinate(10,3);
 
 
         std::vector<TDCoordinate*> path;
@@ -162,7 +162,7 @@
 
 
 
-        for(int i = 0 ; i < 20 ; ++i)
+        for(int i = 0 ; i < 1 ; ++i)
         {
         	addTowerDefenseEnemy(path);
         }
@@ -174,13 +174,18 @@
         //TODO: let the player control his controllable entity && TODO: create a new ControllableEntity for the player
     }
 
+    // Generates a TowerDefenseEnemy. Uses Template "enemytowerdefense". Sets position at first waypoint of path.
+
     void TowerDefense::addTowerDefenseEnemy(std::vector<TDCoordinate*> path){
 
     	orxout() << "test1" << endl;
 
     	TowerDefenseEnemy* en1 = new TowerDefenseEnemy(this->center_->getContext());
-    	en1->addTemplate("spaceshipassff");
-    	/*en1->setInitialHealth(1000);
+        en1->addTemplate("enemytowerdefense");
+        en1->setScale(3);
+
+
+        /*en1->setInitialHealth(1000);
     	en1->setHealth(1000);
     	en1->setMaxHealth(1000);
     	en1->setInitialShieldHealth(1000);
@@ -189,17 +194,18 @@
     	orxout() << "en1 " << en1->getHealth() << endl;
 
 
-        Model* TowerDefenseEnemymodel = new Model(this->center_->getContext());
+        //Model* TowerDefenseEnemymodel = new Model(this->center_->getContext());
 
-        TowerDefenseEnemymodel->setMeshSource("cube.mesh");
+        //TowerDefenseEnemymodel->setMeshSource("cube.mesh");
 
-        TowerDefenseEnemymodel->setPosition(0,0,75);
-        en1->setPosition(0,0,150);
-        TowerDefenseEnemymodel->setScale(10);
+        //TowerDefenseEnemymodel->setPosition(0,0,75);
+        en1->setPosition(path.at(0)->get3dcoordinate());
 
+        //TowerDefenseEnemymodel->setScale(10);
 
-        en1->attach(TowerDefenseEnemymodel);
 
+        //en1->attach(TowerDefenseEnemymodel);
+
         TowerDefenseEnemyvector.push_back(en1);
 
         orxout() << "test2" << endl;




More information about the Orxonox-commit mailing list