- Timestamp:
- May 22, 2019, 1:58:40 PM (5 years ago)
- Location:
- code/branches/Presentation_FS19
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Presentation_FS19
- Property svn:mergeinfo changed
/code/branches/3DPacman_FS19 (added) merged: 12206,12252,12259,12272,12293,12303-12304,12313,12316-12326,12338,12357,12365,12375,12380-12381,12383,12385-12386,12389
- Property svn:mergeinfo changed
-
code/branches/Presentation_FS19/src/modules/pacman/Pacman.cc
r12003 r12408 39 39 RegisterClass(Pacman); 40 40 41 int PACMAN_INTERNAL_PACMAN_POSITION; 42 41 43 Pacman::Pacman(Context* context) : Deathmatch(context) 42 44 { … … 46 48 point = 0; 47 49 level = 1; 50 laser = 5; //after that number of eaten pointSpheres, the laser appears 48 51 49 52 } … … 56 59 } 57 60 61 62 PacmanLaser* pos = *(ObjectList<PacmanLaser>().begin()); 63 pos->resetPacmanLaser(); 64 65 66 58 67 for(PacmanPointAfraid* next : ObjectList<PacmanPointAfraid>()){ 59 68 next->resetPacmanPointAfraid(); … … 73 82 74 83 75 PacmanGhost* ghosts[ 4];84 PacmanGhost* ghosts[8]; 76 85 77 86 78 87 void Pacman::tick(float dt) 79 88 { 89 80 90 SUPER(Pacman, tick, dt); 91 81 92 82 93 //Needed for gameover 83 94 if(deathtime != 0){ 84 95 dead(dt); 96 97 98 85 99 } 86 100 … … 88 102 else{ 89 103 104 //support by laser 105 if(point > laser + 240*(level-1)){ 106 107 for(PacmanPointSphere* pointer : ObjectList<PacmanPointSphere>()){ 108 Vector3 pointSpherePosition = pointer->getPosition(); 109 110 if(pointSpherePosition.y > 0){// pointSphere above surface =not eaten yet 111 112 PacmanLaser* pos = *(ObjectList<PacmanLaser>().begin()); 113 pos->setPosition(pointSpherePosition); 114 break; 115 } 116 117 118 } 119 120 } 121 90 122 //Register ghosts 91 123 int i = 0; 92 for(PacmanGhost* nextghost 124 for(PacmanGhost* nextghost: ObjectList<PacmanGhost>()){ 93 125 ghosts[i] = nextghost; 94 126 i++; 95 127 } 96 97 128 //Switch ghost to not-catchable, if timer is zero 98 129 if(afraid){ … … 137 168 //Check for collisions between to objects (compare float numbers) 138 169 bool Pacman::collis(Vector3 one, Vector3 other){ 139 if((abs(one.x-other.x)<1 0) && (abs(one.y-other.y)<10) && (abs(one.z-other.z)<10))170 if((abs(one.x-other.x)<19) && (abs(one.y-other.y)<10) && (abs(one.z-other.z)<19)) 140 171 return true; 141 172 return false; … … 203 234 void Pacman::takePoint(PacmanPointSphere* taken){ 204 235 ++point; 236 205 237 if(point == totallevelpoint){ 206 238 this->levelUp();
Note: See TracChangeset
for help on using the changeset viewer.