- Timestamp:
- Apr 18, 2019, 1:26:10 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/3DPacman_FS19/src/modules/pacman/PacmanGhost.h
r12303 r12304 38 38 namespace orxonox { 39 39 40 extern Vector3 possibleposition[67]; 41 42 extern bool findpos(Vector3 one, Vector3 other); 43 44 45 struct graphVertex; 46 void findNeighboorVertices(Vector3 actuelposition, graphVertex adjacentVertices[]); 47 void updateShortestDistanceToStart(graphVertex &vertex, graphVertex &neighboor); 48 graphVertex findNextVertexToConsider(graphVertex[]); 49 50 extern graphVertex listOfVertices[]; 51 52 40 53 class _OrxonoxExport PacmanGhost : public ControllableEntity 41 54 { … … 44 57 virtual ~PacmanGhost(); 45 58 46 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ; //!< Method for creating an AutonomousDrone through XML.47 virtual void tick(float dt); //!< Defines which actions the AutonomousDrone has to take in each tick.59 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) ; //!< Method for creating an AutonomousDrone through XML. 60 //virtual void tick(float dt); //!< Defines which actions the AutonomousDrone has to take in each tick. 48 61 49 v oid move(float dt, Vector3 actuelposition, Vector3 velocity);62 virtual void move(float dt, Vector3 actuelposition, Vector3 velocity); 50 63 51 v oid resetGhost();64 virtual void resetGhost(); 52 65 53 v oid changewith(PacmanGhost* otherghost);54 v oid levelupvelo();66 virtual void changewith(PacmanGhost* otherghost); 67 virtual void levelupvelo(); 55 68 56 bool findpos(Vector3 one, Vector3 other);57 v oid changemovability();69 //bool findpos(Vector3 one, Vector3 other); 70 virtual void changemovability(); 58 71 bool dontmove = false; 59 72 60 73 61 74 int decision = 0; 62 75 Vector3 resetposition = Vector3(0,10,15); … … 70 83 bool lockmove = false; 71 84 72 //All positions in the map, see documentation 73 Vector3 possibleposition[67] = {Vector3(20,10,245),Vector3(215,10,245),Vector3(215,10,195),Vector3(185,10,195),Vector3(135,10,195), //0-4 74 Vector3(185,10,150),Vector3(135,10,150),Vector3(215,10,150),Vector3(215,10,105),Vector3(135,10,105), //5-9 75 Vector3(135,10,15),Vector3(135,10,-85),Vector3(215,10,-85),Vector3(135,10,-135),Vector3(215,10,-135), //10-14 76 Vector3(215,10,-195),Vector3(135,10,-195),Vector3(20,10,195),Vector3(-20,10,195),Vector3(-20,10,245), //15-19 77 Vector3(-215,10,245),Vector3(-215,10,195),Vector3(-185,10,195),Vector3(-135,10,195),Vector3(-70,10,195), //20-24 78 Vector3(70,10,195),Vector3(70,10,150),Vector3(20,10,150),Vector3(-20,10,150),Vector3(-70,10,150), //25-29 79 Vector3(-135,10,150),Vector3(-185,10,150),Vector3(-215,10,150),Vector3(-215,10,105),Vector3(-135,10,105), //30-34 80 Vector3(-70,10,105),Vector3(-20,10,105),Vector3(20,10,105),Vector3(70,10,105),Vector3(70,10,60), //35-39 81 Vector3(0,10,60),Vector3(-70,10,60),Vector3(-135,10,15),Vector3(-70,10,60),Vector3(0,10,15), //40-44 82 Vector3(70,10,15),Vector3(-70,10,-35),Vector3(-20,10,-35),Vector3(20,10,-35),Vector3(70,10,-35), //45-49 83 Vector3(70,10,-85),Vector3(20,10,-85),Vector3(-20,10,-85),Vector3(-70,10,-85),Vector3(-135,10,-85), //50-54 84 Vector3(-215,10,-85),Vector3(-215,10,-135),Vector3(-135,10,-135),Vector3(-70,10,-135),Vector3(-20,10,-135), //55-59 85 Vector3(20,10,-135),Vector3(70,10,-135),Vector3(20,10,-195),Vector3(-20,10,-195),Vector3(-135,10,-195), //60-64 86 Vector3(-215,10,-195),Vector3(0,10,-35)}; //65-66 85 Vector3 getShortestPath(Vector3 start, Vector3 goal); 87 86 88 private: 89 void setnewTarget(int firstdec); 90 void setnewTarget(int firstdec, int seconddec); 91 void setnewTarget(int firstdec, int seconddec, int thirddec); 92 void setnewTarget(int firstdec, int seconddec, int thirddec, int fourthdec); 87 Vector3 setPureArrayPos(Vector3 &posToSet); 88 89 private: 93 90 }; 94 91
Note: See TracChangeset
for help on using the changeset viewer.