- Timestamp:
- May 18, 2018, 12:38:37 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.cc
r11976 r11978 58 58 XMLPortParam(PacmanHUDinfo, "showghoststatus", setGhoststatus, getGhoststatus, xmlelement, mode).defaultValues(false); 59 59 XMLPortParam(PacmanHUDinfo, "messageID", setMessageID, getMessageID, xmlelement, mode).defaultValues(0); 60 XMLPortParam(PacmanHUDinfo, "showgameover", setGameover, getGameover, xmlelement, mode).defaultValues(false); 61 XMLPortParam(PacmanHUDinfo, "showlive", setlive, getlive, xmlelement, mode).defaultValues(false); 60 62 61 63 … … 69 71 { 70 72 bool death = this->PacmanGame->isdead(); 71 if(death){ 72 bShowPoints_ = false; 73 bShowGhoststatus_ = false; 73 if(death && showgameover){ 74 74 const std::string& deathmessage = "Game Over"; 75 setTextSize(0. 4);75 setTextSize(0.08); 76 76 this->setCaption(deathmessage); 77 77 } 78 78 79 if(this->bShowPoints_ && !death) {79 if(this->bShowPoints_) { 80 80 const std::string& points = "Collected points: "+multi_cast<std::string>(this->PacmanGame->getPoints()) + " of " + multi_cast<std::string>(this->PacmanGame->totallevelpoint); 81 setTextSize(0.0 4);81 setTextSize(0.03); 82 82 this->setCaption(points); 83 83 } 84 84 85 if(this->bShowGhoststatus_ && !death){ 86 const std::string& ghoststatus = "Do not get caught!"; 87 if(this->PacmanGame->afraid) const std::string& ghoststatus = "Catch the ghosts!"; 88 setTextSize(0.04); 89 this->setCaption(ghoststatus); 85 if(this->bShowGhoststatus_){ 86 if(this->PacmanGame->getAfraid()) { 87 const std::string& ghoststatus = "Catch the ghosts! \n " + multi_cast<std::string>(this->PacmanGame->getTimer()) + " seconds left"; 88 setTextSize(0.03); 89 this->setCaption(ghoststatus); 90 } 91 else{ 92 const std::string& ghoststatus = "Do not get caught!"; 93 setTextSize(0.03); 94 this->setCaption(ghoststatus); 95 } 90 96 } 97 98 if(this->showlive){ 99 const std::string& live = "Remaining lives: "+multi_cast<std::string>(this->PacmanGame->getLives()); 100 setTextSize(0.03); 101 this->setCaption(live); 102 } 103 104 if(death && !(this->showgameover)){ 105 setTextSize(0.0); 106 } 107 91 108 } 92 109 }
Note: See TracChangeset
for help on using the changeset viewer.