Changeset 11954 for code/branches/3DPacman_FS18/src/modules/pacman
- Timestamp:
- May 8, 2018, 1:20:49 PM (7 years ago)
- Location:
- code/branches/3DPacman_FS18/src/modules/pacman
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc
r11953 r11954 66 66 SUPER(Pacman, tick, dt); 67 67 68 if(!timer){ 68 //orxout() << timer << endl; 69 //orxout() << afraid << endl; 70 71 72 if(afraid){ 69 73 timer = timer - dt; 70 74 if(timer<=0){ 71 afraid = false; 72 this->setNormal(); 75 setNormal(); 73 76 } 74 77 } … … 105 108 106 109 for(PacmanPointAfraid* next : ObjectList<PacmanPointAfraid>()){ 107 if( collis(next->getPosition(),currentPosition)){110 if(next->taken(currentPosition)){ 108 111 setAfraid(); 109 112 } … … 155 158 156 159 //Change normal Ghosts with afraid ones 157 if(afraid){158 160 ghosts[4]->changewith(ghosts[0]); 159 161 ghosts[5]->changewith(ghosts[1]); 160 162 ghosts[6]->changewith(ghosts[2]); 161 163 ghosts[7]->changewith(ghosts[3]); 162 }163 164 164 165 afraid = false; … … 198 199 { 199 200 Deathmatch::start(); 201 202 int i = 0; 203 for(PacmanGhost* nextghost : ObjectList<PacmanGhost>()){ 204 if(3<i){ 205 nextghost->setPosition(0,-20,0); 206 nextghost->dontmove = true; 207 }; 208 209 i++; 210 } 200 211 } 201 212 -
code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc
r11939 r11954 74 74 bool PacmanPointAfraid::taken(Vector3 playerpos) 75 75 { 76 if((abs(this->resetposition.x - playerpos.x)<0.1) && (abs(this->resetposition.z - playerpos.z)<0.1)){ 76 Vector3 resetposition = this->getPosition(); 77 78 if((abs(resetposition.x - playerpos.x)<1) && (abs(resetposition.z - playerpos.z)<1)){ 77 79 this->setPosition(Vector3(resetposition.x, -50, resetposition.z)); 78 80 return true;
Note: See TracChangeset
for help on using the changeset viewer.