[Orxonox-commit 7339] r11956 - in code/branches/3DPacman_FS18: data/levels src/modules/pacman

dreherm at orxonox.net dreherm at orxonox.net
Fri May 11 13:44:20 CEST 2018


Author: dreherm
Date: 2018-05-11 13:44:20 +0200 (Fri, 11 May 2018)
New Revision: 11956

Modified:
   code/branches/3DPacman_FS18/data/levels/3DPacman.oxw
   code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc
   code/branches/3DPacman_FS18/src/modules/pacman/Pacman.h
   code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc
   code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.h
   code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointSphere.cc
Log:
Collisionshapes and Powerpoints

Modified: code/branches/3DPacman_FS18/data/levels/3DPacman.oxw
===================================================================
--- code/branches/3DPacman_FS18/data/levels/3DPacman.oxw	2018-05-08 11:53:11 UTC (rev 11955)
+++ code/branches/3DPacman_FS18/data/levels/3DPacman.oxw	2018-05-11 11:44:20 UTC (rev 11956)
@@ -15,6 +15,8 @@
   include("templates/PacmanGelb.oxt")
 ?>
 
+<!-- include("templates/spaceshipEscort.oxt") -->
+
 <Level
   plugins = pacman
   gametype = Pacman
@@ -31,8 +33,10 @@
   >
 
     <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"/>
-    <SpawnPoint team=0 position="0,10,245" lookat="0,0,0" spawnclass=PacmanGelb pawndesign=PacmanGelb />
+    <SpawnPoint team=0 position="0,10,150" lookat="0,0,0" spawnclass=PacmanGelb pawndesign=PacmanGelb />
 
+    <!-- <SpawnPoint team=0 position="0,10,150" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort /> -->
+
 <!-- GHOSTS -->
 <PacmanGhost position="0,10,15" >
     <attached>
@@ -85,13 +89,157 @@
 
 
 
-<!-- POINTS -->
-<PacmanPointSphere position="0,10,0">
+<!-- POINTS first Line -->
+<PacmanPointSphere position="-215,10,245">
     <attached>
         <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
     </attached>
 </PacmanPointSphere>
 
+<PacmanPointSphere position="-197,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-179,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-161,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-143,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-125,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-107,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-89,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-71,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-53,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-35,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-20,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-7,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="7,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="20,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="38,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="56,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="74,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="92,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="110,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="128,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="146,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="164,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="182,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="200,10,245">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
 <PacmanPointSphere position="215,10,245">
     <attached>
         <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
@@ -98,6 +246,128 @@
     </attached>
 </PacmanPointSphere>
 
+
+<!-- POINTS seconde Line -->
+<PacmanPointSphere position="-215,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-197,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-179,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-161,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-143,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-125,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<!-- 7 and 8 -->
+
+<PacmanPointSphere position="-71,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-53,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-35,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="-20,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<!-- 13 and 14 -->
+
+<PacmanPointSphere position="20,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="38,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="56,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="74,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<!-- 19 and 20 -->
+
+<PacmanPointSphere position="128,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="146,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="164,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="182,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
+<PacmanPointSphere position="200,10,195">
+    <attached>
+        <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
+    </attached>
+</PacmanPointSphere>
+
 <PacmanPointSphere position="215,10,195">
     <attached>
         <Model position="0,0,0" mesh="PacmanPointSphere.mesh" scale="5" />
@@ -105,6 +375,9 @@
 </PacmanPointSphere>
 
 
+
+
+
 <!-- AfraidPoints -->
 <PacmanPointAfraid position="215,10,195">
     <attached>
@@ -121,10 +394,10 @@
     <collisionShapes> 
 
   <!-- Edge -->  
-  <BoxCollisionShape position="250,10,0" halfExtents="1,15,250" />
-  <BoxCollisionShape position="-250,10,0" halfExtents="1,15,250" />
-  <BoxCollisionShape position="0,10,250" halfExtents="250,15,1" />
-  <BoxCollisionShape position="0,10,-250" halfExtents="250,15,1" />
+  <BoxCollisionShape position="250,10,0" halfExtents="15,15,250" />
+  <BoxCollisionShape position="-250,10,0" halfExtents="15,15,250" />
+  <BoxCollisionShape position="0,10,250" halfExtents="250,15,15" />
+  <BoxCollisionShape position="0,10,-250" halfExtents="250,15,15" />
 
    <!-- Shapes in order -->    
   <BoxCollisionShape position="-200,10,-65" halfExtents="55,15,35" />
@@ -131,7 +404,40 @@
   <BoxCollisionShape position="-200,10,30" halfExtents="55,15,35" />
   <BoxCollisionShape position="200,10,-65" halfExtents="55,15,35" />
   <BoxCollisionShape position="200,10,30" halfExtents="55,15,35" />
+  <BoxCollisionShape position="-175,10,-195" halfExtents="30,15,20" /> <!-- 5 -->  
+  <BoxCollisionShape position="-80,10,-195" halfExtents="40,15,20" />
+  <BoxCollisionShape position="-175,10,-140" halfExtents="30,15,10" />
+  <BoxCollisionShape position="0,10,-210" halfExtents="10,15,30" />
+  <BoxCollisionShape position="80,10,-195" halfExtents="40,15,20" />
+  <BoxCollisionShape position="175,10,-195" halfExtents="30,15,20" /> <!-- 10 -->
+  <BoxCollisionShape position="175,10,-140" halfExtents="30,15,10" />
+  <BoxCollisionShape position="0,10,-140" halfExtents="60,15,10" />
+  <BoxCollisionShape position="0,10,-110" halfExtents="10,15,25" />
+  <BoxCollisionShape position="-100,10,-90" halfExtents="10,15,60" />
+  <BoxCollisionShape position="-70,10,-90" halfExtents="25,15,10" /> <!-- 15 -->
+  <BoxCollisionShape position="100,10,-90" halfExtents="10,15,60" />
+  <BoxCollisionShape position="70,10,-90" halfExtents="25,15,10" />
+  <BoxCollisionShape position="0,10,-20" halfExtents="60,15,35" />
+  <BoxCollisionShape position="-100,10,30" halfExtents="10,15,35" />
+  <BoxCollisionShape position="0,10,50" halfExtents="60,15,10" /> <!-- 20 -->
+  <BoxCollisionShape position="0,10,80" halfExtents="10,15,25" />
+  <BoxCollisionShape position="100,10,30" halfExtents="10,15,35" />
+  <BoxCollisionShape position="-175,10,100" halfExtents="30,15,10" />
+  <BoxCollisionShape position="-155,10,130" halfExtents="10,15,25" />
+  <BoxCollisionShape position="-75,10,100" halfExtents="35,15,10" /> <!-- 25 -->
+  <BoxCollisionShape position="75,10,100" halfExtents="35,15,10" />
+  <BoxCollisionShape position="175,10,100" halfExtents="30,15,10" />
+  <BoxCollisionShape position="155,10,130" halfExtents="10,15,25" />
+  <BoxCollisionShape position="-220,10,150" halfExtents="20,15,10" />
+  <BoxCollisionShape position="-220,10,150" halfExtents="20,15,10" /> <!-- 30 -->
+  <BoxCollisionShape position="0,10,150" halfExtents="60,15,10" />
+  <BoxCollisionShape position="0,10,180" halfExtents="10,15,25" />
+  <BoxCollisionShape position="-100,10,170" halfExtents="10,15,25" />
+  <BoxCollisionShape position="-125,10,200" halfExtents="80,15,10" />
+  <BoxCollisionShape position="100,10,170" halfExtents="10,15,25" /> <!-- 35 -->
+  <BoxCollisionShape position="125,10,200" halfExtents="80,15,10" />
 
+
     </collisionShapes> 
 </StaticEntity>
 

Modified: code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc	2018-05-08 11:53:11 UTC (rev 11955)
+++ code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc	2018-05-11 11:44:20 UTC (rev 11956)
@@ -44,7 +44,7 @@
         RegisterObject(Pacman);
 
        // firstGame = true;                   //needed for the HUD
-        lives = 10;
+        lives = 3;
         point = 0;
         level = 1;
 
@@ -67,6 +67,7 @@
 
         //orxout() << timer << endl;
         //orxout() << afraid << endl;
+        //orxout() << totallevelpoint << endl;
 
 
         if(afraid){
@@ -166,8 +167,8 @@
     } 
 
     void Pacman::posreset(){
-        for(PacmanGhost* nextghost : ObjectList<PacmanGhost>()){
-            nextghost->resetGhost();
+        for(int i = 0; i<4; ++i){
+            ghosts[i]->resetGhost();
         }
         player->setPosition(startposplayer);
     }
@@ -205,9 +206,11 @@
                 nextghost->setPosition(0,-20,0);
                 nextghost->dontmove =  true;
             };
-            
             i++;
         }
+
+        totallevelpoint = ObjectList<PacmanPointSphere>().size();
+
     }
 
 

Modified: code/branches/3DPacman_FS18/src/modules/pacman/Pacman.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/Pacman.h	2018-05-08 11:53:11 UTC (rev 11955)
+++ code/branches/3DPacman_FS18/src/modules/pacman/Pacman.h	2018-05-11 11:44:20 UTC (rev 11956)
@@ -95,8 +95,8 @@
             PacmanGelb* player;
             bool bcolli = false;
             float timer = 0;
-            Vector3 startposplayer = Vector3(0,10,245);
-            int totallevelpoint = 3;
+            Vector3 startposplayer = Vector3(0,10,150);
+            int totallevelpoint;
             //bool firstGame;
             bool afraid = false;
             

Modified: code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc	2018-05-08 11:53:11 UTC (rev 11955)
+++ code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc	2018-05-11 11:44:20 UTC (rev 11956)
@@ -44,7 +44,7 @@
     PacmanPointAfraid::PacmanPointAfraid(Context* context) : ControllableEntity(context)
     {
         RegisterObject(PacmanPointAfraid);
-        this->setCollisionType(CollisionType::None); 
+        this->setCollisionType(CollisionType::None);
     }
 
     /**
@@ -72,9 +72,8 @@
     }
 
     bool PacmanPointAfraid::taken(Vector3 playerpos)
-    {
-      Vector3 resetposition = this->getPosition();  
-      
+    { 
+        resetposition = this->getPosition();
       if((abs(resetposition.x - playerpos.x)<1) && (abs(resetposition.z - playerpos.z)<1)){
         this->setPosition(Vector3(resetposition.x, -50, resetposition.z));
         return true;

Modified: code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.h	2018-05-08 11:53:11 UTC (rev 11955)
+++ code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.h	2018-05-11 11:44:20 UTC (rev 11956)
@@ -49,7 +49,6 @@
             bool taken(Vector3 playerpos);
             void resetPacmanPointAfraid();
         private:
-            
             Vector3 resetposition;
     };
 

Modified: code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointSphere.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointSphere.cc	2018-05-08 11:53:11 UTC (rev 11955)
+++ code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointSphere.cc	2018-05-11 11:44:20 UTC (rev 11956)
@@ -44,7 +44,7 @@
     PacmanPointSphere::PacmanPointSphere(Context* context) : ControllableEntity(context)
     {
         RegisterObject(PacmanPointSphere);
-        this->setCollisionType(CollisionType::None); 
+        this->setCollisionType(CollisionType::None);
     }
 
     /**
@@ -73,7 +73,8 @@
 
     bool PacmanPointSphere::taken(Vector3 playerpos)
     {
-      if((abs(this->resetposition.x - playerpos.x)<0.1) && (abs(this->resetposition.z - playerpos.z)<0.1)){
+        resetposition = this->getPosition();
+      if((abs(this->resetposition.x - playerpos.x)<5) && (abs(this->resetposition.z - playerpos.z)<5)){
         this->setPosition(Vector3(resetposition.x, -50, resetposition.z));
         return true;
       } 



More information about the Orxonox-commit mailing list