Changeset 11921 for code/branches/3DPacman_FS18/src/modules
- Timestamp:
- Apr 29, 2018, 1:55:17 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc
r11919 r11921 46 46 RegisterObject(PacmanGhost); 47 47 48 this->velocity = Vector3(0, 0, 0);48 /* this->velocity = Vector3(0, 0, 0); 49 49 50 50 this->setCollisionType(CollisionType::Dynamic); … … 55 55 56 56 this->target_x = actuelposition.x; 57 this->target_z = actuelposition.z; 57 this->target_z = actuelposition.z; */ 58 58 59 59 } … … 78 78 79 79 80 80 /* 81 81 Vector3 possibleposition[] = {Vector3(20,10,245),Vector3(215,10,245),Vector3(215,10,195),Vector3(185,10,195),Vector3(135,10,195), //0-4 82 82 Vector3(185,10,150),Vector3(135,10,150),Vector3(215,10,150),Vector3(215,10,105),Vector3(135,10,105), //5-9 … … 94 94 Vector3(-215,10,-195),Vector3(0,10,-35) //65-66 95 95 }; 96 96 */ 97 97 /** 98 98 @brief … … 106 106 107 107 //setorientation 108 108 /* 109 109 this->actuelposition = this->getPosition(); 110 110 … … 331 331 } //End of Position table 332 332 } 333 333 */ 334 334 } 335 335 336 336 void PacmanGhost::setnewTarget(int firstdec){ 337 /* 337 338 decision = rand()%1; 338 339 switch(decision){ … … 343 344 break; 344 345 } 345 } 346 347 void PacmanGhost::setnewTarget(int firstdec, int seconddec){ 346 */ 347 } 348 349 void PacmanGhost::setnewTarget(int firstdec, int seconddec){ /* 348 350 decision = rand()%2; 349 351 switch(decision){ … … 359 361 break; 360 362 } 363 */ 361 364 } 362 365 363 366 void PacmanGhost::setnewTarget(int firstdec, int seconddec, int thirddec){ 367 /* 364 368 decision = rand()%3; 365 369 switch(decision){ … … 380 384 break; 381 385 } 386 */ 382 387 } 383 388 384 389 void PacmanGhost::setnewTarget(int firstdec, int seconddec, int thirddec, int fourthdec){ 390 /* 385 391 decision = rand()%4; 386 392 switch(decision){ … … 406 412 break; 407 413 } 414 */ 408 415 } 409 416 … … 411 418 412 419 void PacmanGhost::move(float dt, Vector3 actuelposition, Vector3 velocity){ 413 this->setPosition(Vector3(actuelposition.x+20*velocity.x*dt,10,actuelposition.z+20*velocity.z*dt));420 // this->setPosition(Vector3(actuelposition.x+20*velocity.x*dt,10,actuelposition.z+20*velocity.z*dt)); 414 421 } 415 422 416 423 bool PacmanGhost::findpos(Vector3 one, Vector3 other){ 417 if((abs(one.x - other.x)<0.5) && (abs(one.z - other.z)<0.5)) return true;418 return false; 424 /* if((abs(one.x - other.x)<0.5) && (abs(one.z - other.z)<0.5)) return true; 425 return false; */ 419 426 } 420 427 421 428 void PacmanGhost::resetGhost(){ 429 /* 422 430 this->setPosition(this->resetposition); 423 431 this->ismoving = false; … … 426 434 this->target_x = actuelposition.x; 427 435 this->target_z = actuelposition.z; 436 */ 428 437 } 429 438 }
Note: See TracChangeset
for help on using the changeset viewer.