Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 18, 2019, 1:26:10 PM (5 years ago)
Author:
peterf
Message:

added several pacmans

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/3DPacman_FS19/src/modules/pacman/PacmanGhost.h

    r12303 r12304  
    3838namespace orxonox {
    3939
     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
    4053    class _OrxonoxExport PacmanGhost : public ControllableEntity
    4154    {
     
    4457            virtual ~PacmanGhost();
    4558
    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.
    4861
    49             void move(float dt, Vector3 actuelposition, Vector3 velocity);
     62            virtual void move(float dt, Vector3 actuelposition, Vector3 velocity);
    5063           
    51             void resetGhost();
     64            virtual void resetGhost();
    5265
    53             void changewith(PacmanGhost* otherghost);
    54             void levelupvelo();
     66            virtual void changewith(PacmanGhost* otherghost);
     67            virtual void levelupvelo();
    5568
    56             bool findpos(Vector3 one, Vector3 other);     
    57             void changemovability();
     69            //bool findpos(Vector3 one, Vector3 other);     
     70            virtual void changemovability();
    5871            bool dontmove = false;
    5972
    60 
     73       
    6174            int decision = 0;
    6275            Vector3 resetposition = Vector3(0,10,15);
     
    7083            bool lockmove = false;
    7184
    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);
    8786
    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:
    9390    };
    9491
Note: See TracChangeset for help on using the changeset viewer.