Changeset 11958 for code/branches/3DPacman_FS18/src/modules
- Timestamp:
- May 13, 2018, 12:39:06 AM (7 years ago)
- Location:
- code/branches/3DPacman_FS18/src/modules/pacman
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/3DPacman_FS18/src/modules/pacman/CMakeLists.txt
r11939 r11958 5 5 PacmanPointSphere.cc 6 6 PacmanPointAfraid.cc 7 PacmanHUDinfo.cc 7 8 ) 8 9 -
code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc
r11956 r11958 55 55 void Pacman::levelUp() 56 56 { 57 this->end(); 57 for(PacmanPointSphere* nextsphere : ObjectList<PacmanPointSphere>()){ 58 nextsphere->resetPacmanPointSphere(); 59 } 60 61 for(PacmanPointAfraid* next : ObjectList<PacmanPointAfraid>()){ 62 next->resetPacmanPointAfraid(); 63 } 64 65 for(PacmanGhost* nextghost : ObjectList<PacmanGhost>()){ 66 nextghost->levelupvelo(); 67 } 68 this->posreset(); 58 69 } 59 70 … … 217 228 void Pacman::end() 218 229 { 219 /* 220 firstGame = false; 221 222 //Set randomized deathmessages 223 if(point<7) sDeathMessage = DeathMessage7[rand()%(DeathMessage7.size())]; 224 else if(point<20) sDeathMessage = DeathMessage20[rand()%(DeathMessage20.size())]; 225 else if(point<30) sDeathMessage = DeathMessage30[rand()%(DeathMessage30.size())]; 226 else sDeathMessage = DeathMessageover30[rand()%(DeathMessageover30.size())]; 227 228 //Update Highscore 229 if (Highscore::exists()) 230 { 231 int score = this->getPoints(); 232 Highscore::getInstance().storeScore("Pacman", score, this->getPlayer()->getPlayer()); 233 } 234 235 230 231 /* 236 232 if (Highscore::exists()) 237 233 { -
code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc
r11952 r11958 466 466 467 467 } 468 469 void levelupvelo(){ 470 velocity.x = velocity.x + 2; 471 velocity.y = velocity.y + 2; 472 velocity.z = velocity.z + 2; 473 } 468 474 } -
code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.h
r11951 r11958 56 56 void setnewTarget(int firstdec, int seconddec, int thirddec, int fourthdec); 57 57 void changewith(PacmanGhost* otherghost); 58 void levelupvelo(); 58 59 59 60 bool findpos(Vector3 one, Vector3 other); … … 65 66 bool ismoving = false; 66 67 int target_x = 0; 67 int target_z = 0; 68 int target_z = 0; 69 Vector3 velocity; 68 70 69 71 private: 70 72 int decision = 0; //Gives the random which way information to the ghost. 71 Vector3 velocity;72 73 Vector3 resetposition = Vector3(0,10,15); 73 74 }; -
code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.cc
r11931 r11958 65 65 if (this->PacmanGame) 66 66 { 67 if(not this->PacmanGame->isDead()){68 67 if(this->bShowPoints_){ 69 68 const std::string& points = "Score: "+multi_cast<std::string>(this->PacmanGame->getPoints()); … … 71 70 this->setCaption(points); 72 71 } 73 else if(this->bShowMessage_){74 setTextSize(0);75 }76 }77 else{78 if(this->bShowPoints_){79 setTextSize(0);80 }81 else if(this->bShowMessage_){82 if(this->PacmanGame->firstGame){83 if(messageID==3){84 setTextSize(0.05);85 this->setCaption("First click, then press space to start");86 }87 }88 else{89 std::string message;90 setTextSize(0.05);91 switch(messageID){92 case 0:93 message = "Game Over";94 setTextSize(0.1);95 this->setCaption(message);96 break;97 case 1:98 message = this->PacmanGame->sDeathMessage;99 break;100 case 2:101 message = "Your Score: "+multi_cast<std::string>(this->PacmanGame->getPoints())+102 " Local High Score: "+multi_cast<std::string>(Highscore::getInstance().getHighestScoreOfGame("Flappy Orx"));103 break;104 case 3:105 time_t time = this->PacmanGame->getPlayer()->timeUntilRespawn();106 if(time<=0)107 message = "Press space to restart.";108 else109 message = "Please wait "+multi_cast<std::string>(time)+" seconds.";110 break;111 }112 this->setCaption(message);113 }114 }115 }116 72 } 117 } 73 } 118 74 119 75 void PacmanHUDinfo::changedOwner()
Note: See TracChangeset
for help on using the changeset viewer.