Changeset 11956 for code/branches/3DPacman_FS18/src/modules
- Timestamp:
- May 11, 2018, 1:44:20 PM (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/Pacman.cc
r11954 r11956 45 45 46 46 // firstGame = true; //needed for the HUD 47 lives = 10;47 lives = 3; 48 48 point = 0; 49 49 level = 1; … … 68 68 //orxout() << timer << endl; 69 69 //orxout() << afraid << endl; 70 //orxout() << totallevelpoint << endl; 70 71 71 72 … … 167 168 168 169 void Pacman::posreset(){ 169 for( PacmanGhost* nextghost : ObjectList<PacmanGhost>()){170 nextghost->resetGhost();170 for(int i = 0; i<4; ++i){ 171 ghosts[i]->resetGhost(); 171 172 } 172 173 player->setPosition(startposplayer); … … 206 207 nextghost->dontmove = true; 207 208 }; 208 209 209 i++; 210 210 } 211 212 totallevelpoint = ObjectList<PacmanPointSphere>().size(); 213 211 214 } 212 215 -
code/branches/3DPacman_FS18/src/modules/pacman/Pacman.h
r11945 r11956 96 96 bool bcolli = false; 97 97 float timer = 0; 98 Vector3 startposplayer = Vector3(0,10, 245);99 int totallevelpoint = 3;98 Vector3 startposplayer = Vector3(0,10,150); 99 int totallevelpoint; 100 100 //bool firstGame; 101 101 bool afraid = false; -
code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc
r11954 r11956 45 45 { 46 46 RegisterObject(PacmanPointAfraid); 47 this->setCollisionType(CollisionType::None); 47 this->setCollisionType(CollisionType::None); 48 48 } 49 49 … … 73 73 74 74 bool PacmanPointAfraid::taken(Vector3 playerpos) 75 { 76 Vector3 resetposition = this->getPosition(); 77 75 { 76 resetposition = this->getPosition(); 78 77 if((abs(resetposition.x - playerpos.x)<1) && (abs(resetposition.z - playerpos.z)<1)){ 79 78 this->setPosition(Vector3(resetposition.x, -50, resetposition.z)); -
code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.h
r11939 r11956 50 50 void resetPacmanPointAfraid(); 51 51 private: 52 53 52 Vector3 resetposition; 54 53 }; -
code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointSphere.cc
r11915 r11956 45 45 { 46 46 RegisterObject(PacmanPointSphere); 47 this->setCollisionType(CollisionType::None); 47 this->setCollisionType(CollisionType::None); 48 48 } 49 49 … … 74 74 bool PacmanPointSphere::taken(Vector3 playerpos) 75 75 { 76 if((abs(this->resetposition.x - playerpos.x)<0.1) && (abs(this->resetposition.z - playerpos.z)<0.1)){ 76 resetposition = this->getPosition(); 77 if((abs(this->resetposition.x - playerpos.x)<5) && (abs(this->resetposition.z - playerpos.z)<5)){ 77 78 this->setPosition(Vector3(resetposition.x, -50, resetposition.z)); 78 79 return true;
Note: See TracChangeset
for help on using the changeset viewer.