- Timestamp:
- May 17, 2018, 4:14:35 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc
r11958 r11976 45 45 46 46 // firstGame = true; //needed for the HUD 47 lives = 3;47 lives = 0; 48 48 point = 0; 49 49 level = 1; … … 77 77 SUPER(Pacman, tick, dt); 78 78 79 //orxout() << timer << endl; 80 //orxout() << afraid << endl; 81 //orxout() << totallevelpoint << endl; 82 79 if(deathtime != 0){ 80 dead(dt); 81 } 82 83 else{ 83 84 84 85 if(afraid){ 85 86 timer = timer - dt; 86 87 if(timer<=0){ 87 88 setNormal(); 88 89 } 89 90 } 91 90 92 91 93 int i = 0; … … 109 111 110 112 if(bcolli){ 111 this->catched( );113 this->catched(dt); 112 114 } 113 115 … … 125 127 } 126 128 129 } 130 131 132 133 127 134 } 128 135 … … 134 141 } 135 142 136 void Pacman::catched( ){143 void Pacman::catched(float dt){ 137 144 138 145 if(!afraid) { 139 if(!lives) this->end(); 146 if(!lives){ 147 deathtime = 5; 148 this->dead(dt); 149 } 140 150 --lives; 141 151 this->posreset(); … … 225 235 } 226 236 237 bool Pacman::isdead(){ 238 return death; 239 } 240 241 void Pacman::dead(float dt){ 242 death = true; 243 244 deathtime = deathtime-dt; 245 246 if(deathtime<0) 247 this->end(); 248 } 227 249 228 250 void Pacman::end()
Note: See TracChangeset
for help on using the changeset viewer.