[Orxonox-commit 5465] r10128 - in code/branches/surfaceraceHS14: data/levels data/levels/templates src/modules/dodgerace2

sriedel at orxonox.net sriedel at orxonox.net
Wed Nov 19 16:00:53 CET 2014


Author: sriedel
Date: 2014-11-19 16:00:53 +0100 (Wed, 19 Nov 2014)
New Revision: 10128

Added:
   code/branches/surfaceraceHS14/data/levels/DodgeRace.oxw
Modified:
   code/branches/surfaceraceHS14/data/levels/templates/spaceshipDodgeRace.oxt
   code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.cc
   code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.h
Log:
Should work so far

Added: code/branches/surfaceraceHS14/data/levels/DodgeRace.oxw
===================================================================
--- code/branches/surfaceraceHS14/data/levels/DodgeRace.oxw	                        (rev 0)
+++ code/branches/surfaceraceHS14/data/levels/DodgeRace.oxw	2014-11-19 15:00:53 UTC (rev 10128)
@@ -0,0 +1,77 @@
+<LevelInfo
+ name = "Dodge Race"
+ description = "2D Arcade shooter. Maximise your points!!!\nTip: try to keep the multiplier high by avoiding shots and enemies."
+ tags = "minigame"
+ screenshot = "orxonoxArcade.png"
+/>
+<?lua
+  include("stats.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/spaceshipAssff2.oxt")
+  include("templates/spaceshipPirate.oxt")
+  include("templates/spaceshipDodgeRace.oxt")
+  include("templates/enemyInvader.oxt")
+  include("overlays/InvaderHUD.oxo")
+?>
+
+<Level gametype = DodgeRace>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "2.0, 2.0, 2.0"
+    skybox       = "Orxonox/skyBoxClouds"
+    negativeWorldRange = "-100000, -100000, -100000"
+    positiveWorldRange = " 100000,  100000,  100000"
+  >
+
+  <WorldAmbientSound
+    source="Earth.ogg"
+    looping="true"
+    playOnLoad="true"
+  />
+
+    <!-- <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/> -->
+    <Light type=directional position="1100, 11000, -7000" lookat="0, 0, 0" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
+    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=DodgeRaceShip pawndesign=spaceshipdodgerace />
+
+    <DistanceTrigger name="start" position="-200,0,0" target="Pawn" distance=10 stayActive="true" delay=0 />
+
+
+    <DodgeRaceCenterPoint name=invadercenter />
+    
+    
+  <StaticEntity position="1500,0,50" direction="0,0,0"   scale="1" collisionType=static mass=0 friction=0.01 >
+      <attached>
+        <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50,50,50" />
+      </attached>
+
+      <collisionShapes>
+        <BoxCollisionShape position="0,0,0" halfExtents="50,50,50" />
+      </collisionShapes>
+
+  </StaticEntity>
+  <StaticEntity position="4500,0,-30" direction="0,0,0"   scale="1" collisionType=static mass=1 friction=0.01 >
+      <attached>
+        <Model position="0,0,0" mesh="blackcube.mesh" scale3D="50,50,50" />
+      </attached>
+
+      <collisionShapes>
+        <BoxCollisionShape position="0,0,0" halfExtents="50,50,50" />
+      </collisionShapes>
+
+  </StaticEntity>
+    
+    
+    
+    
+    
+    
+  </Scene>
+</Level>
+

Modified: code/branches/surfaceraceHS14/data/levels/templates/spaceshipDodgeRace.oxt
===================================================================
--- code/branches/surfaceraceHS14/data/levels/templates/spaceshipDodgeRace.oxt	2014-11-19 13:10:51 UTC (rev 10127)
+++ code/branches/surfaceraceHS14/data/levels/templates/spaceshipDodgeRace.oxt	2014-11-19 15:00:53 UTC (rev 10128)
@@ -6,13 +6,13 @@
    spawnparticleduration  = 3
    explosionchunks        = 4
 
-   health            = 80
-   maxhealth         = 200
-   initialhealth     = 80
+   health            = 40
+   maxhealth         = 40
+   initialhealth     = 40
 
-   shieldhealth        = 35
-   initialshieldhealth = 35
-   maxshieldhealth     = 60
+   shieldhealth        = 80
+   initialshieldhealth = 80
+   maxshieldhealth     = 80
    shieldabsorption    = 0.9
    reloadrate          = 1
    reloadwaittime      = 1
@@ -34,11 +34,12 @@
 
    collisionType     = "dynamic"
    mass              = 4200000
-   linearDamping     = 0.7
+   linearDamping     = 0.9999999
    angularDamping    = 0.9999999
 
-    collisiondamage = 100
-    enablecollisiondamage = true
+   collisiondamage = 100
+   enablecollisiondamage = true
+   
   >
     <engines>
       <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipinvaderengine />
@@ -67,9 +68,8 @@
 <Template name=spaceshipescortcameras defaults=0>
   <DodgeRaceShip>
     <camerapositions>
-      <CameraPosition position="0,30,120" direction="0, 0, -1" drag=false mouselook=true /> 
-      <CameraPosition position="0,300,-100" direction="0, -1, 0" drag=false mouselook=true />
-      <CameraPosition position="0,300,-100" direction="1, 0, 0" drag=false mouselook=true />
+      <CameraPosition position="0,30,150" direction="0, 0, -1" drag=false mouselook=true /> 
+      <CameraPosition position="0,1300,-100" direction="0, -1, 0" drag=false mouselook=true />
     </camerapositions>
   </DodgeRaceShip>
 </Template>

Modified: code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.cc
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.cc	2014-11-19 13:10:51 UTC (rev 10127)
+++ code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.cc	2014-11-19 15:00:53 UTC (rev 10128)
@@ -88,8 +88,12 @@
 
         // shoot!
         if (isFireing)
-            ControllableEntity::fire(0);
+        {
+        	//pos += Vector3(900, 0, 0) * dt;
+            //ControllableEntity::fire(0);
+        }
 
+
         // Camera
         WeakPtr<Camera> camera = this->getCamera();
         if (camera != NULL)
@@ -102,7 +106,9 @@
 
         // bring back on track!
         if(pos.y != 0)
-            pos.y = 0;
+        {
+        	pos.y = 0;
+        }
 
         setPosition(pos);
         setOrientation(Vector3::UNIT_Y, Degree(270));
@@ -134,45 +140,25 @@
     void DodgeRaceShip::moveRightLeft(const Vector2& value)
     {
     	lastTimeLeft = 0;
-    	desiredVelocity.x = -value.x * speed;
+    	desiredVelocity.x = value.x * speed;
     }
     void DodgeRaceShip::boost(bool bBoost)
     {
         isFireing = bBoost;
     }
-    /*
+
     inline bool DodgeRaceShip::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
     {
-        // orxout() << "touch!!! " << endl; //<< otherObject << " at " << contactPoint;
-        WeakPtr<DodgeRaceEnemy> enemy = orxonox_cast<DodgeRaceEnemy*>(otherObject);
-        WeakPtr<Projectile> shot = orxonox_cast<Projectile*>(otherObject);
-        // ensure that this gets only called once per enemy.
-        if (enemy != NULL && lastEnemy != enemy)
+        if (otherObject != NULL && lastEntity != otherObject)
         {
-            lastEnemy = enemy;
-
-            removeHealth(20);
-            if (getGame())
-            {
-                getGame()->multiplier = 1;
-            }
+        	lastEntity = otherObject;
+        	removeHealth(20);
+            //this->death();
         }
-        // was shot, decrease multiplier
-        else if (shot != NULL  && lastShot != shot)
-        {
-            if (getGame() && orxonox_cast<DodgeRaceEnemy*>(shot->getShooter()) != NULL)
-            {
-                if (getGame()->multiplier > 1)
-                {
-                    lastShot = shot;
-                    getGame()->multiplier -= 1;
-                }
-            }
-        }
+
         return false;
-        // SUPER(DodgeRaceShip, collidesAgainst, otherObject, contactPoint);
     }
-*/
+
     WeakPtr<DodgeRace> DodgeRaceShip::getGame()
     {
         if (game == NULL)

Modified: code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.h
===================================================================
--- code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.h	2014-11-19 13:10:51 UTC (rev 10127)
+++ code/branches/surfaceraceHS14/src/modules/dodgerace2/DodgeRaceShip.h	2014-11-19 15:00:53 UTC (rev 10128)
@@ -78,9 +78,11 @@
             virtual void death();
 
         private:
+            virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
             WeakPtr<DodgeRace> getGame();
             WeakPtr<DodgeRace> game;
             WeakPtr<Projectile> lastShot;
+            WeakPtr<WorldEntity> lastEntity;
             Camera* camera;
             float lastTimeFront, lastTimeLeft, lastTime;
             struct Velocity
@@ -89,17 +91,6 @@
 			   float y;
             } velocity, desiredVelocity;
 
-
-
-
-/*
- 	 	 	 virtual inline bool collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint);
-
-        private:
-
-            WeakPtr<DodgeRaceEnemy> lastEnemy;
-           */
-
     };
 }
 




More information about the Orxonox-commit mailing list