[Orxonox-commit 7344] r11961 - in code/branches/3DPacman_FS18: data/levels data/overlays src/modules/pacman
dreherm at orxonox.net
dreherm at orxonox.net
Mon May 14 13:08:07 CEST 2018
Author: dreherm
Date: 2018-05-14 13:08:06 +0200 (Mon, 14 May 2018)
New Revision: 11961
Modified:
code/branches/3DPacman_FS18/data/levels/3DPacman.oxw
code/branches/3DPacman_FS18/data/overlays/PacmanHUD.oxo
code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.cc
code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.h
Log:
HUD work
Modified: code/branches/3DPacman_FS18/data/levels/3DPacman.oxw
===================================================================
--- code/branches/3DPacman_FS18/data/levels/3DPacman.oxw 2018-05-12 22:56:52 UTC (rev 11960)
+++ code/branches/3DPacman_FS18/data/levels/3DPacman.oxw 2018-05-14 11:08:06 UTC (rev 11961)
@@ -1769,48 +1769,48 @@
<collisionShapes>
<!-- Edge -->
- <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" />
+ <BoxCollisionShape position="250,30,0" halfExtents="15,15,250" />
+ <BoxCollisionShape position="-250,30,0" halfExtents="15,15,250" />
+ <BoxCollisionShape position="0,30,250" halfExtents="250,15,15" />
+ <BoxCollisionShape position="0,30,-250" halfExtents="250,15,15" />
<!-- Shapes in order -->
- <BoxCollisionShape position="-200,10,-65" halfExtents="55,15,35" />
- <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" />
+ <BoxCollisionShape position="-200,30,-65" halfExtents="55,15,35" />
+ <BoxCollisionShape position="-200,30,30" halfExtents="55,15,35" />
+ <BoxCollisionShape position="200,30,-65" halfExtents="55,15,35" />
+ <BoxCollisionShape position="200,30,30" halfExtents="55,15,35" />
+ <BoxCollisionShape position="-175,30,-195" halfExtents="30,15,20" /> <!-- 5 -->
+ <BoxCollisionShape position="-80,30,-195" halfExtents="40,15,20" />
+ <BoxCollisionShape position="-175,30,-140" halfExtents="30,15,10" />
+ <BoxCollisionShape position="0,30,-210" halfExtents="10,15,30" />
+ <BoxCollisionShape position="80,30,-195" halfExtents="40,15,20" />
+ <BoxCollisionShape position="175,30,-195" halfExtents="30,15,20" /> <!-- 10 -->
+ <BoxCollisionShape position="175,30,-140" halfExtents="30,15,10" />
+ <BoxCollisionShape position="0,30,-140" halfExtents="60,15,10" />
+ <BoxCollisionShape position="0,30,-110" halfExtents="10,15,25" />
+ <BoxCollisionShape position="-100,30,-90" halfExtents="10,15,60" />
+ <BoxCollisionShape position="-70,30,-90" halfExtents="25,15,10" /> <!-- 15 -->
+ <BoxCollisionShape position="100,30,-90" halfExtents="10,15,60" />
+ <BoxCollisionShape position="70,30,-90" halfExtents="25,15,10" />
+ <BoxCollisionShape position="0,30,-20" halfExtents="60,15,35" />
+ <BoxCollisionShape position="-100,30,30" halfExtents="10,15,35" />
+ <BoxCollisionShape position="0,30,50" halfExtents="60,15,10" /> <!-- 20 -->
+ <BoxCollisionShape position="0,30,80" halfExtents="10,15,25" />
+ <BoxCollisionShape position="100,30,30" halfExtents="10,15,35" />
+ <BoxCollisionShape position="-175,30,100" halfExtents="30,15,10" />
+ <BoxCollisionShape position="-155,30,130" halfExtents="10,15,25" />
+ <BoxCollisionShape position="-75,30,100" halfExtents="35,15,10" /> <!-- 25 -->
+ <BoxCollisionShape position="75,30,100" halfExtents="35,15,10" />
+ <BoxCollisionShape position="175,30,100" halfExtents="30,15,10" />
+ <BoxCollisionShape position="155,30,130" halfExtents="10,15,25" />
+ <BoxCollisionShape position="-220,30,150" halfExtents="20,15,10" />
+ <BoxCollisionShape position="-220,30,150" halfExtents="20,15,10" /> <!-- 30 -->
+ <BoxCollisionShape position="0,30,150" halfExtents="60,15,10" />
+ <BoxCollisionShape position="0,30,180" halfExtents="10,15,25" />
+ <BoxCollisionShape position="-100,30,170" halfExtents="10,15,25" />
+ <BoxCollisionShape position="-125,30,200" halfExtents="80,15,10" />
+ <BoxCollisionShape position="100,30,170" halfExtents="10,15,25" /> <!-- 35 -->
+ <BoxCollisionShape position="125,30,200" halfExtents="80,15,10" />
</collisionShapes>
Modified: code/branches/3DPacman_FS18/data/overlays/PacmanHUD.oxo
===================================================================
--- code/branches/3DPacman_FS18/data/overlays/PacmanHUD.oxo 2018-05-12 22:56:52 UTC (rev 11960)
+++ code/branches/3DPacman_FS18/data/overlays/PacmanHUD.oxo 2018-05-14 11:08:06 UTC (rev 11961)
@@ -4,17 +4,35 @@
</Template>
<Template name="PacmanHUD">
<OverlayGroup name="PacmanHUD" scale = "1, 1">
-
+
+ </OverlayGroup>
+</Template>
+
+
+<Template name="spaceshiphud">
+ <OverlayGroup name = "spaceshiphud" scale = "1, 1">
+
<PacmanHUDinfo
- position = "0.02, 0.01"
+ position = "0.4, 0.01"
pickpoint = "0.0, 0.0"
font = "ShareTechMono"
textsize = 0.04
colour = "1.0, 1.0, 1.0, 1.0"
- align = "left"
+ align = "right"
showpoints = true
/>
-
- </OverlayGroup>
-</Template>
\ No newline at end of file
+
+ <PacmanHUDinfo
+ position = "0.4, 0.1"
+ pickpoint = "0.0, 0.0"
+ font = "ShareTechMono"
+ textsize = 0.04
+ colour = "1.0, 1.0, 1.0, 1.0"
+ align = "right"
+
+ showghoststatus = true
+ />
+
+ </OverlayGroup>
+</Template>
Modified: code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.cc 2018-05-12 22:56:52 UTC (rev 11960)
+++ code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.cc 2018-05-14 11:08:06 UTC (rev 11961)
@@ -44,7 +44,9 @@
this->PacmanGame = nullptr;
this->bShowPoints_ = false;
this->bShowMessage_ = false;
+ this->bShowGhoststatus_ = false;
this->messageID = 0;
+
}
void PacmanHUDinfo::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -53,6 +55,7 @@
XMLPortParam(PacmanHUDinfo, "showpoints", setShowPoints, getShowPoints, xmlelement, mode).defaultValues(false);
XMLPortParam(PacmanHUDinfo, "showmessage", setShowMessage, getShowMessage, xmlelement, mode).defaultValues(false);
+ XMLPortParam(PacmanHUDinfo, "showghoststatus", setGhoststatus, getGhoststatus, xmlelement, mode).defaultValues(false);
XMLPortParam(PacmanHUDinfo, "messageID", setMessageID, getMessageID, xmlelement, mode).defaultValues(0);
@@ -65,10 +68,17 @@
if (this->PacmanGame)
{
if(this->bShowPoints_){
- const std::string& points = "Score: "+multi_cast<std::string>(this->PacmanGame->getPoints());
+ const std::string& points = "Collected points: "+multi_cast<std::string>(this->PacmanGame->getPoints()) + " of " + multi_cast<std::string>(this->PacmanGame->totallevelpoint);
setTextSize(0.04);
this->setCaption(points);
}
+ if(this->bShowGhoststatus_){
+ const std::string& ghoststatus = "Do not get caught!";
+ //if(this->PacmanGame->afraid) const std::string& ghoststatus = "Catch the ghosts!";
+ orxout() << "Test Hier" << endl;
+ setTextSize(0.04);
+ this->setCaption(ghoststatus);
+ }
}
}
Modified: code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.h 2018-05-12 22:56:52 UTC (rev 11960)
+++ code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.h 2018-05-14 11:08:06 UTC (rev 11961)
@@ -62,10 +62,17 @@
inline int getMessageID() const
{ return messageID; }
+ inline void setGhoststatus(int value){
+ this->bShowGhoststatus_ = value;
+ }
+ inline int getGhoststatus() const
+ { return this->bShowGhoststatus_; }
+
private:
Pacman* PacmanGame;
bool bShowPoints_;
bool bShowMessage_;
+ bool bShowGhoststatus_;
int messageID;
};
}
More information about the Orxonox-commit
mailing list