[Orxonox-commit 7341] r11958 - in code/branches/3DPacman_FS18: data/levels data/overlays src/modules/pacman
dreherm at orxonox.net
dreherm at orxonox.net
Sun May 13 00:39:06 CEST 2018
Author: dreherm
Date: 2018-05-13 00:39:06 +0200 (Sun, 13 May 2018)
New Revision: 11958
Modified:
code/branches/3DPacman_FS18/data/levels/3DPacman.oxw
code/branches/3DPacman_FS18/data/overlays/PacmanHUD.oxo
code/branches/3DPacman_FS18/src/modules/pacman/CMakeLists.txt
code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc
code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc
code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.h
code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.cc
Log:
HUD test 1
Modified: code/branches/3DPacman_FS18/data/levels/3DPacman.oxw
===================================================================
--- code/branches/3DPacman_FS18/data/levels/3DPacman.oxw 2018-05-11 23:31:25 UTC (rev 11957)
+++ code/branches/3DPacman_FS18/data/levels/3DPacman.oxw 2018-05-12 22:39:06 UTC (rev 11958)
@@ -7,7 +7,7 @@
<?lua
include("stats.oxo")
- include("HUDTemplates3.oxo")
+ include("PacmanHUD.oxo")
include("templates/lodInformation.oxt")
?>
Modified: code/branches/3DPacman_FS18/data/overlays/PacmanHUD.oxo
===================================================================
--- code/branches/3DPacman_FS18/data/overlays/PacmanHUD.oxo 2018-05-11 23:31:25 UTC (rev 11957)
+++ code/branches/3DPacman_FS18/data/overlays/PacmanHUD.oxo 2018-05-12 22:39:06 UTC (rev 11958)
@@ -1,5 +1,5 @@
-<Template name="pacmanhud">
- <OverlayGroup name = "pacmanhud" scale = "1, 1">
+<Template name="spectatorhud">
+ <OverlayGroup name = "spectator" scale = "1, 1">
</OverlayGroup>
</Template>
<Template name="PacmanHUD">
@@ -15,55 +15,6 @@
showpoints = true
/>
-
- <PacmanHUDinfo
- position = "0.5, 0.5"
- pickpoint = "0.0, 0.0"
- font = "ShareTechMono"
- textsize = 0.04
- colour = "1.0, 0.0, 0.0, 1.0"
- align = "center"
-
- showmessage = true
- messageID = 0
-
- />
-
- <PacmanHUDinfo
- position = "0.5, 0.6"
- pickpoint = "0.0, 0.0"
- font = "ShareTechMono"
- textsize = 0.04
- colour = "1.0, 1.0, 1.0, 1.0"
- align = "center"
-
- showmessage = true
- messageID = 1
- />
- <PacmanHUDinfo
- position = "0.5, 0.65"
- pickpoint = "0.0, 0.0"
- font = "ShareTechMono"
- textsize = 0.04
- colour = "1.0, 1.0, 1.0, 1.0"
- align = "center"
-
- showmessage = true
- messageID = 2
- />
- <PacmanHUDinfo
- position = "0.5, 0.7"
- pickpoint = "0.0, 0.0"
- font = "ShareTechMono"
- textsize = 0.04
- colour = "1.0, 1.0, 1.0, 1.0"
- align = "center"
-
- showmessage = true
- messageID = 3
-
- />
-
</OverlayGroup>
</Template>
\ No newline at end of file
Modified: code/branches/3DPacman_FS18/src/modules/pacman/CMakeLists.txt
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/CMakeLists.txt 2018-05-11 23:31:25 UTC (rev 11957)
+++ code/branches/3DPacman_FS18/src/modules/pacman/CMakeLists.txt 2018-05-12 22:39:06 UTC (rev 11958)
@@ -4,6 +4,7 @@
PacmanGelb.cc
PacmanPointSphere.cc
PacmanPointAfraid.cc
+ PacmanHUDinfo.cc
)
ORXONOX_ADD_LIBRARY(pacman
Modified: code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc 2018-05-11 23:31:25 UTC (rev 11957)
+++ code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc 2018-05-12 22:39:06 UTC (rev 11958)
@@ -54,7 +54,18 @@
void Pacman::levelUp()
{
- this->end();
+ for(PacmanPointSphere* nextsphere : ObjectList<PacmanPointSphere>()){
+ nextsphere->resetPacmanPointSphere();
+ }
+
+ for(PacmanPointAfraid* next : ObjectList<PacmanPointAfraid>()){
+ next->resetPacmanPointAfraid();
+ }
+
+ for(PacmanGhost* nextghost : ObjectList<PacmanGhost>()){
+ nextghost->levelupvelo();
+ }
+ this->posreset();
}
@@ -216,23 +227,8 @@
void Pacman::end()
{
- /*
- firstGame = false;
-
- //Set randomized deathmessages
- if(point<7) sDeathMessage = DeathMessage7[rand()%(DeathMessage7.size())];
- else if(point<20) sDeathMessage = DeathMessage20[rand()%(DeathMessage20.size())];
- else if(point<30) sDeathMessage = DeathMessage30[rand()%(DeathMessage30.size())];
- else sDeathMessage = DeathMessageover30[rand()%(DeathMessageover30.size())];
-
- //Update Highscore
- if (Highscore::exists())
- {
- int score = this->getPoints();
- Highscore::getInstance().storeScore("Pacman", score, this->getPlayer()->getPlayer());
- }
-
+ /*
if (Highscore::exists())
{
//int score = this->getPoints();
Modified: code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc 2018-05-11 23:31:25 UTC (rev 11957)
+++ code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc 2018-05-12 22:39:06 UTC (rev 11958)
@@ -465,4 +465,10 @@
this->target_z = actuelposition.z;
}
+
+ void levelupvelo(){
+ velocity.x = velocity.x + 2;
+ velocity.y = velocity.y + 2;
+ velocity.z = velocity.z + 2;
+ }
}
\ No newline at end of file
Modified: code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.h 2018-05-11 23:31:25 UTC (rev 11957)
+++ code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.h 2018-05-12 22:39:06 UTC (rev 11958)
@@ -55,6 +55,7 @@
void setnewTarget(int firstdec, int seconddec, int thirddec);
void setnewTarget(int firstdec, int seconddec, int thirddec, int fourthdec);
void changewith(PacmanGhost* otherghost);
+ void levelupvelo();
bool findpos(Vector3 one, Vector3 other);
void changemovability();
@@ -64,11 +65,11 @@
Vector3 actuelposition;
bool ismoving = false;
int target_x = 0;
- int target_z = 0;
+ int target_z = 0;
+ Vector3 velocity;
private:
int decision = 0; //Gives the random which way information to the ghost.
- Vector3 velocity;
Vector3 resetposition = Vector3(0,10,15);
};
Modified: code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.cc 2018-05-11 23:31:25 UTC (rev 11957)
+++ code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.cc 2018-05-12 22:39:06 UTC (rev 11958)
@@ -64,57 +64,13 @@
if (this->PacmanGame)
{
- if(not this->PacmanGame->isDead()){
if(this->bShowPoints_){
const std::string& points = "Score: "+multi_cast<std::string>(this->PacmanGame->getPoints());
setTextSize(0.04);
this->setCaption(points);
}
- else if(this->bShowMessage_){
- setTextSize(0);
- }
- }
- else{
- if(this->bShowPoints_){
- setTextSize(0);
- }
- else if(this->bShowMessage_){
- if(this->PacmanGame->firstGame){
- if(messageID==3){
- setTextSize(0.05);
- this->setCaption("First click, then press space to start");
- }
- }
- else{
- std::string message;
- setTextSize(0.05);
- switch(messageID){
- case 0:
- message = "Game Over";
- setTextSize(0.1);
- this->setCaption(message);
- break;
- case 1:
- message = this->PacmanGame->sDeathMessage;
- break;
- case 2:
- message = "Your Score: "+multi_cast<std::string>(this->PacmanGame->getPoints())+
- " Local High Score: "+multi_cast<std::string>(Highscore::getInstance().getHighestScoreOfGame("Flappy Orx"));
- break;
- case 3:
- time_t time = this->PacmanGame->getPlayer()->timeUntilRespawn();
- if(time<=0)
- message = "Press space to restart.";
- else
- message = "Please wait "+multi_cast<std::string>(time)+" seconds.";
- break;
- }
- this->setCaption(message);
- }
- }
- }
}
- }
+ }
void PacmanHUDinfo::changedOwner()
{
More information about the Orxonox-commit
mailing list