[Orxonox-commit 7248] r11862 - in code/branches/3DPacman_FS18: data/levels data/levels/templates src/modules/Pacman src/modules/dodgerace
dreherm at orxonox.net
dreherm at orxonox.net
Fri Apr 13 13:08:47 CEST 2018
Author: dreherm
Date: 2018-04-13 13:08:46 +0200 (Fri, 13 Apr 2018)
New Revision: 11862
Added:
code/branches/3DPacman_FS18/src/modules/Pacman/PacmanPrereqs.h
Modified:
code/branches/3DPacman_FS18/data/levels/3DPacman.oxw
code/branches/3DPacman_FS18/data/levels/templates/PacmanGelb.oxt
code/branches/3DPacman_FS18/src/modules/Pacman/3DPacman.cc
code/branches/3DPacman_FS18/src/modules/Pacman/CMakeLists.txt
code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGelb.h
code/branches/3DPacman_FS18/src/modules/dodgerace/DodgeRaceShip.cc
Log:
Work on player
Modified: code/branches/3DPacman_FS18/data/levels/3DPacman.oxw
===================================================================
--- code/branches/3DPacman_FS18/data/levels/3DPacman.oxw 2018-04-12 14:16:02 UTC (rev 11861)
+++ code/branches/3DPacman_FS18/data/levels/3DPacman.oxw 2018-04-13 11:08:46 UTC (rev 11862)
@@ -12,7 +12,7 @@
?>
<?lua
- include("templates/spaceshipEscort.oxt")
+ include("templates/PacmanGelb.oxt")
?>
<Level>
@@ -27,7 +27,7 @@
>
<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=SpaceShip pawndesign=spaceshipescort />
+ <SpawnPoint team=0 position="0,10,245" lookat="0,0,0" spawnclass=SpaceShip pawndesign=PacmanGelb />
<PacmanGhost position="0,20,245">
Modified: code/branches/3DPacman_FS18/data/levels/templates/PacmanGelb.oxt
===================================================================
--- code/branches/3DPacman_FS18/data/levels/templates/PacmanGelb.oxt 2018-04-12 14:16:02 UTC (rev 11861)
+++ code/branches/3DPacman_FS18/data/levels/templates/PacmanGelb.oxt 2018-04-13 11:08:46 UTC (rev 11862)
@@ -1,5 +1,5 @@
<Template name=PacmanGelb>
- <SpaceShip
+ <PacmanGelb
hudtemplate = spaceshiphud
camerapositiontemplate = spaceshipescortcameras
spawnparticlesource = "Orxonox/fairytwirl"
@@ -62,15 +62,15 @@
<?lua
include("../includes/weaponSettingsEscort.oxi")
?>
- </SpaceShip>
+ </PacmanGelb>
</Template>
<Template name=spaceshipescortcameras defaults=0>
- <SpaceShip>
+ <PacmanGelb>
<camerapositions>
<CameraPosition position="0,0, 60" drag=false mouselook=true />
</camerapositions>
- </SpaceShip>
+ </PacmanGelb>
</Template>
<Template name=spaceshipescortengine baseclass=MultiStateEngine>
Modified: code/branches/3DPacman_FS18/src/modules/Pacman/3DPacman.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/Pacman/3DPacman.cc 2018-04-12 14:16:02 UTC (rev 11861)
+++ code/branches/3DPacman_FS18/src/modules/Pacman/3DPacman.cc 2018-04-13 11:08:46 UTC (rev 11862)
@@ -48,6 +48,7 @@
lives = 3;
point = 0:
level = 1;
+ Vector3 startposplayer = Vector3(0,10,245);
}
@@ -69,12 +70,6 @@
i++;
}
- i = 0:
- for(PacmanPointSphere* nextsphere : ObjectList<PacmanPointSphere>()){
- spheres[i] = nextsphere;
- i++;
- }
-
player = this->getPlayer();
if (player != nullptr)
{
@@ -89,12 +84,18 @@
this->catched();
}
+ i = 0;
+ for(PacmanPointSphere* nextsphere : ObjectList<PacmanPointSphere>()){
+ if(collis(nextsphere.getPosition(), currentPosition)){
+ takePoint(nextsphere);
+ }
+ }
+
SUPER(3DPacman, tick, dt);
}
-
bool 3DPacman::collis(Vector3 one, Vector3 other){
if((abs(one.x-other.x)<0.1) && (abs(one.x-other.x)<0.1) && (abs(one.x-other.x)<0.1))
return true;
@@ -102,7 +103,7 @@
}
void 3DPacman::catched(){
- if(lives) this->end();
+ if(!lives) this->end();
--lives;
this->posreset();
}
@@ -110,13 +111,22 @@
void 3DPacman::posreset(){
int i = 0;
for(PacmanGhost* nextghost : ObjectList<PacmanGhost>()){
- ghosts[i] = nextghost;
+ nextghost.resetGhost();
i++;
}
-
+ player.setPosition(startposplayer);
}
+ void 3DPacman::takePoint(PacmanPointSphere* taken){
+ ++point;
+ if(point == totallevelpoint) this->levelUp;
+ Vector3 postaken = taken.getPosition();
+ postaken.y = -50;
+ taken.setPosition(postaken);
+ }
+
+
PacmanGelb* 3DPacman::getPlayer()
{
for (PacmanGelb* ship : ObjectList<PacmanGelb>())
@@ -146,10 +156,6 @@
void 3DPacman::end()
{
- // DON'T CALL THIS!
- // Deathmatch::end();
- // It will misteriously crash the game!
- // Instead startMainMenu, this won't crash.
if (Highscore::exists())
{
int score = this->getPoints();
Modified: code/branches/3DPacman_FS18/src/modules/Pacman/CMakeLists.txt
===================================================================
--- code/branches/3DPacman_FS18/src/modules/Pacman/CMakeLists.txt 2018-04-12 14:16:02 UTC (rev 11861)
+++ code/branches/3DPacman_FS18/src/modules/Pacman/CMakeLists.txt 2018-04-13 11:08:46 UTC (rev 11862)
@@ -1,5 +1,6 @@
SET_SOURCE_FILES(PICKUP_SRC_FILES
PacmanGhost.cc
+ PacmanGelb.cc
)
ORXONOX_ADD_LIBRARY(Pacman
Modified: code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGelb.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGelb.h 2018-04-12 14:16:02 UTC (rev 11861)
+++ code/branches/3DPacman_FS18/src/modules/Pacman/PacmanGelb.h 2018-04-13 11:08:46 UTC (rev 11862)
@@ -35,7 +35,7 @@
#define _PacmanGelb_H__
-#include "dodgerace/DodgeRacePrereqs.h"
+#include "Pacman/PacmanPrereqs.h"
#include "core/XMLPort.h"
#include "worldentities/pawns/SpaceShip.h"
@@ -43,7 +43,7 @@
namespace orxonox
{
- class _PacmanGelbExport PacmanGelb : public SpaceShip
+ class _PacmanExport PacmanGelb : public SpaceShip
{
public:
PacmanGelb(Context* context);
@@ -52,9 +52,9 @@
private:
Vector3 actuelposition;
- btQuaternion actuelorient;
+ Quaternion actuelorient;
- }
+ };
}
-#endif
\ No newline at end of file
+#endif
Added: code/branches/3DPacman_FS18/src/modules/Pacman/PacmanPrereqs.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/Pacman/PacmanPrereqs.h (rev 0)
+++ code/branches/3DPacman_FS18/src/modules/Pacman/PacmanPrereqs.h 2018-04-13 11:08:46 UTC (rev 11862)
@@ -0,0 +1,73 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Florian Zinggeler
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ at file
+ at brief
+ Shared library macros, enums, constants and forward declarations for the DodgeRace module
+*/
+
+#ifndef _PacmanPrereqs_H__
+#define _PacmanPrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(PACMAN_STATIC_BUILD)
+# ifdef PACMAN_SHARED_BUILD
+# define _PacmanExport __declspec(dllexport)
+# else
+# if defined( __MINGW32__ )
+# define _PacmanExport
+# else
+# define _PacmanExport __declspec(dllimport)
+# endif
+# endif
+# define _PacmanPrivate
+#elif defined (ORXONOX_GCC_VISIBILITY)
+# define _PacmanExport __attribute__ ((visibility("default")))
+# define _PacmanPrivate __attribute__ ((visibility("hidden")))
+#else
+# define _PacmanExport
+# define _PacmanPrivate
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+
+}
+
+#endif
Modified: code/branches/3DPacman_FS18/src/modules/dodgerace/DodgeRaceShip.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/dodgerace/DodgeRaceShip.cc 2018-04-12 14:16:02 UTC (rev 11861)
+++ code/branches/3DPacman_FS18/src/modules/dodgerace/DodgeRaceShip.cc 2018-04-13 11:08:46 UTC (rev 11862)
@@ -105,7 +105,7 @@
}
setPosition(pos);
- setOrientation(Vector3::UNIT_Y, Degree(270));
+ //setOrientation(Vector3::UNIT_Y, Degree(270));
// Level up!
if (pos.x > 42000)
More information about the Orxonox-commit
mailing list