Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 11, 2018, 1:44:20 PM (7 years ago)
Author:
dreherm
Message:

Collisionshapes and Powerpoints

Location:
code/branches/3DPacman_FS18/src/modules/pacman
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc

    r11954 r11956  
    4545
    4646       // firstGame = true;                   //needed for the HUD
    47         lives = 10;
     47        lives = 3;
    4848        point = 0;
    4949        level = 1;
     
    6868        //orxout() << timer << endl;
    6969        //orxout() << afraid << endl;
     70        //orxout() << totallevelpoint << endl;
    7071
    7172
     
    167168
    168169    void Pacman::posreset(){
    169         for(PacmanGhost* nextghost : ObjectList<PacmanGhost>()){
    170             nextghost->resetGhost();
     170        for(int i = 0; i<4; ++i){
     171            ghosts[i]->resetGhost();
    171172        }
    172173        player->setPosition(startposplayer);
     
    206207                nextghost->dontmove =  true;
    207208            };
    208            
    209209            i++;
    210210        }
     211
     212        totallevelpoint = ObjectList<PacmanPointSphere>().size();
     213
    211214    }
    212215
  • code/branches/3DPacman_FS18/src/modules/pacman/Pacman.h

    r11945 r11956  
    9696            bool bcolli = false;
    9797            float timer = 0;
    98             Vector3 startposplayer = Vector3(0,10,245);
    99             int totallevelpoint = 3;
     98            Vector3 startposplayer = Vector3(0,10,150);
     99            int totallevelpoint;
    100100            //bool firstGame;
    101101            bool afraid = false;
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc

    r11954 r11956  
    4545    {
    4646        RegisterObject(PacmanPointAfraid);
    47         this->setCollisionType(CollisionType::None); 
     47        this->setCollisionType(CollisionType::None);
    4848    }
    4949
     
    7373
    7474    bool PacmanPointAfraid::taken(Vector3 playerpos)
    75     {
    76       Vector3 resetposition = this->getPosition(); 
    77      
     75    {
     76        resetposition = this->getPosition();
    7877      if((abs(resetposition.x - playerpos.x)<1) && (abs(resetposition.z - playerpos.z)<1)){
    7978        this->setPosition(Vector3(resetposition.x, -50, resetposition.z));
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.h

    r11939 r11956  
    5050            void resetPacmanPointAfraid();
    5151        private:
    52            
    5352            Vector3 resetposition;
    5453    };
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointSphere.cc

    r11915 r11956  
    4545    {
    4646        RegisterObject(PacmanPointSphere);
    47         this->setCollisionType(CollisionType::None); 
     47        this->setCollisionType(CollisionType::None);
    4848    }
    4949
     
    7474    bool PacmanPointSphere::taken(Vector3 playerpos)
    7575    {
    76       if((abs(this->resetposition.x - playerpos.x)<0.1) && (abs(this->resetposition.z - playerpos.z)<0.1)){
     76        resetposition = this->getPosition();
     77      if((abs(this->resetposition.x - playerpos.x)<5) && (abs(this->resetposition.z - playerpos.z)<5)){
    7778        this->setPosition(Vector3(resetposition.x, -50, resetposition.z));
    7879        return true;
Note: See TracChangeset for help on using the changeset viewer.