Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 5, 2018, 12:12:36 AM (6 years ago)
Author:
dreherm
Message:

Afraid Test 7

File:
1 edited

Legend:

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

    r11944 r11945  
    5151       
    5252        this->actuelposition = this->getPosition();
     53
     54        if(findpos(actuelposition, Vector3(0,-20,0)))
     55            dontmove = true;
    5356       
    5457        this->target_x = actuelposition.x;
     
    414417        }
    415418
     419    void changewith(PacmanGhost* otherghost){
     420        otherghost->setPosition(this->getPosition());
     421        this->setPosition(0,-20,0);
     422        otherghost->target_x = this->target_x;   //Probleme bei parallelen Porzessen
     423        otherghost->target_y = this->target_y;
     424        otherghost->ismoving = this->ismoving;
     425
     426        this->dontmove = true;
     427        otherghost->dontmove = false;
     428    }
    416429
    417430
     
    422435
    423436    bool PacmanGhost::findpos(Vector3 one, Vector3 other){
    424        if((abs(one.x - other.x)<0.5) && (abs(one.z - other.z)<0.5)) return true;
     437       if((abs(one.x - other.x)<0.5) && (abs(one.y - other.y)<0.5) && (abs(one.z - other.z)<0.5)) return true;
    425438        return false;
    426439    }
Note: See TracChangeset for help on using the changeset viewer.