[Orxonox-commit 7337] r11954 - in code/branches/3DPacman_FS18: New Material/meshes data/levels src/modules/pacman

dreherm at orxonox.net dreherm at orxonox.net
Tue May 8 13:20:49 CEST 2018


Author: dreherm
Date: 2018-05-08 13:20:49 +0200 (Tue, 08 May 2018)
New Revision: 11954

Modified:
   code/branches/3DPacman_FS18/New Material/meshes/OgreXMLConverter.log
   code/branches/3DPacman_FS18/data/levels/3DPacman.oxw
   code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc
   code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc
Log:
Added Ghostchange

Modified: code/branches/3DPacman_FS18/New Material/meshes/OgreXMLConverter.log
===================================================================
--- code/branches/3DPacman_FS18/New Material/meshes/OgreXMLConverter.log	2018-05-08 09:44:09 UTC (rev 11953)
+++ code/branches/3DPacman_FS18/New Material/meshes/OgreXMLConverter.log	2018-05-08 11:20:49 UTC (rev 11954)
@@ -1,33 +1,33 @@
-11:29:05: Creating resource group General
-11:29:05: Creating resource group Internal
-11:29:05: Creating resource group Autodetect
-11:29:05: Registering ResourceManager for type Mesh
-11:29:05: Registering ResourceManager for type Material
-11:29:05: Registering ResourceManager for type Skeleton
-11:29:08: XMLMeshSerializer reading mesh data from PacmanMap.mesh.xml...
-11:29:11: Reading geometry...
-11:29:15: Geometry done...
-11:29:15: Reading submeshes...
-11:29:15: Submeshes done.
-11:29:15: Reading mesh names...
-11:29:15: Mesh names done.
-11:29:15: XMLMeshSerializer import successful.
-11:29:15: Reorganising vertex buffers to automatic layout..
-11:29:16: MeshSerializer writing mesh data to stream ...
-11:29:16: File header written.
-11:29:16: Writing mesh data...
-11:29:16: Writing submesh...
-11:29:16: Exporting submesh texture aliases...
-11:29:16: Submesh texture aliases exported.
-11:29:16: Submesh exported.
-11:29:16: Exporting bounds information....
-11:29:16: Bounds information exported.
-11:29:16: Exporting submesh name table...
-11:29:16: Submesh name table exported.
-11:29:16: Exporting edge lists...
-11:29:16: Edge lists exported
-11:29:16: Mesh data exported.
-11:29:16: MeshSerializer export successful.
-11:29:16: Unregistering ResourceManager for type Skeleton
-11:29:16: Unregistering ResourceManager for type Material
-11:29:16: Unregistering ResourceManager for type Mesh
+11:54:27: Creating resource group General
+11:54:27: Creating resource group Internal
+11:54:27: Creating resource group Autodetect
+11:54:27: Registering ResourceManager for type Mesh
+11:54:27: Registering ResourceManager for type Material
+11:54:27: Registering ResourceManager for type Skeleton
+11:54:27: XMLMeshSerializer reading mesh data from PacmanPointAfraid.mesh.xml...
+11:54:27: Reading geometry...
+11:54:27: Geometry done...
+11:54:27: Reading submeshes...
+11:54:27: Submeshes done.
+11:54:27: Reading mesh names...
+11:54:27: Mesh names done.
+11:54:27: XMLMeshSerializer import successful.
+11:54:27: Reorganising vertex buffers to automatic layout..
+11:54:27: MeshSerializer writing mesh data to stream ...
+11:54:27: File header written.
+11:54:27: Writing mesh data...
+11:54:27: Writing submesh...
+11:54:27: Exporting submesh texture aliases...
+11:54:27: Submesh texture aliases exported.
+11:54:27: Submesh exported.
+11:54:27: Exporting bounds information....
+11:54:27: Bounds information exported.
+11:54:27: Exporting submesh name table...
+11:54:27: Submesh name table exported.
+11:54:27: Exporting edge lists...
+11:54:27: Edge lists exported
+11:54:27: Mesh data exported.
+11:54:27: MeshSerializer export successful.
+11:54:27: Unregistering ResourceManager for type Skeleton
+11:54:27: Unregistering ResourceManager for type Material
+11:54:27: Unregistering ResourceManager for type Mesh

Modified: code/branches/3DPacman_FS18/data/levels/3DPacman.oxw
===================================================================
--- code/branches/3DPacman_FS18/data/levels/3DPacman.oxw	2018-05-08 09:44:09 UTC (rev 11953)
+++ code/branches/3DPacman_FS18/data/levels/3DPacman.oxw	2018-05-08 11:20:49 UTC (rev 11954)
@@ -61,25 +61,25 @@
 
 <PacmanGhost position="0,-20,0" >
     <attached>
-        <Model position="0,0,0" mesh="PacmanGhostAfraid.mesh" scale="5" />
+        <Model position="0,0,0" mesh="PacmanAfraidGhost.mesh" scale="5" />
     </attached>
 </PacmanGhost>
 
 <PacmanGhost position="0,-20,0" >
     <attached>
-        <Model position="0,0,0" mesh="PacmanGhostAfraid.mesh" scale="5" />
+        <Model position="0,0,0" mesh="PacmanAfraidGhost.mesh" scale="5" />
     </attached>
 </PacmanGhost>
 
 <PacmanGhost position="0,-20,0" >
     <attached>
-        <Model position="0,0,0" mesh="PacmanGhostAfraid.mesh" scale="5" />
+        <Model position="0,0,0" mesh="PacmanAfraidGhost.mesh" scale="5" />
     </attached>
 </PacmanGhost>
 
 <PacmanGhost position="0,-20,0" >
     <attached>
-        <Model position="0,0,0" mesh="PacmanGhostAfraid.mesh" scale="5" />
+        <Model position="0,0,0" mesh="PacmanAfraidGhost.mesh" scale="5" />
     </attached>
 </PacmanGhost>
 
@@ -108,7 +108,7 @@
 <!-- AfraidPoints -->
 <PacmanPointAfraid position="215,10,195">
     <attached>
-        <Model position="0,0,0" mesh="PacmanPointAfraid.mesh" scale="5" />
+        <Model position="0,0,0" mesh="PacmanPointAfraid.mesh" scale="10" />
     </attached>
 </PacmanPointAfraid>
 

Modified: code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc	2018-05-08 09:44:09 UTC (rev 11953)
+++ code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc	2018-05-08 11:20:49 UTC (rev 11954)
@@ -65,11 +65,14 @@
     {
         SUPER(Pacman, tick, dt);
 
-        if(!timer){
+        //orxout() << timer << endl;
+        //orxout() << afraid << endl;
+
+
+        if(afraid){
             timer = timer - dt;
             if(timer<=0){
-                afraid = false;
-                this->setNormal();
+                setNormal();
             }
         }
 
@@ -104,7 +107,7 @@
         }
 
         for(PacmanPointAfraid* next : ObjectList<PacmanPointAfraid>()){
-            if(collis(next->getPosition(), currentPosition)){
+            if(next->taken(currentPosition)){
                 setAfraid();
             }
         }
@@ -154,12 +157,10 @@
         timer = 0;
 
         //Change normal Ghosts with afraid ones
-        if(afraid){
             ghosts[4]->changewith(ghosts[0]);
             ghosts[5]->changewith(ghosts[1]);
             ghosts[6]->changewith(ghosts[2]);
             ghosts[7]->changewith(ghosts[3]);
-        }
 
         afraid = false; 
     } 
@@ -197,6 +198,16 @@
     void Pacman::start()
     {
         Deathmatch::start();
+
+        int i = 0;
+        for(PacmanGhost* nextghost : ObjectList<PacmanGhost>()){
+            if(3<i){ 
+                nextghost->setPosition(0,-20,0);
+                nextghost->dontmove =  true;
+            };
+            
+            i++;
+        }
     }
 
 

Modified: code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc	2018-05-08 09:44:09 UTC (rev 11953)
+++ code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc	2018-05-08 11:20:49 UTC (rev 11954)
@@ -73,7 +73,9 @@
 
     bool PacmanPointAfraid::taken(Vector3 playerpos)
     {
-      if((abs(this->resetposition.x - playerpos.x)<0.1) && (abs(this->resetposition.z - playerpos.z)<0.1)){
+      Vector3 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;
       } 



More information about the Orxonox-commit mailing list