Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/modules/pacman/PacmanRed.cc @ 12289

Last change on this file since 12289 was 12289, checked in by peterf, 5 years ago
File size: 636 bytes
Line 
1
2        #include "getShortestPath.h"
3        #include "PacmanGhost.h"
4
5       
6       
7
8        struct PacmanRed(){
9
10        Vector3 nextPos;
11
12        PacmanRed(){ 
13                nextPos=(0,0,0);
14        }
15
16
17        while(true){
18
19                if(findPos(nextPos, this->pos)){
20                        moveToPlayer(this->pos, player->pos);
21                }
22        }
23
24
25        void PacmanRed::moveToPlayer (Vector3 redPos, Vector3 playerPos){
26                                                                //this->pos       
27
28                //while(playerPos!=this->pos){}
29
30
31                        nextPos=getShortestPath(redPos, playerPos);
32                        this->target_x = nextPos.x;
33            this->target_z = nextPos.z; 
34            this->ismoving = true;
35
36          /*  while(true){
37            if(findPos(this->pos, nextPos))
38                break;
39                        }*/
40        }
41
42}
43
44
45
Note: See TracBrowser for help on using the repository browser.