Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Added Ghostchange

File:
1 edited

Legend:

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

    r11953 r11954  
    6666        SUPER(Pacman, tick, dt);
    6767
    68         if(!timer){
     68        //orxout() << timer << endl;
     69        //orxout() << afraid << endl;
     70
     71
     72        if(afraid){
    6973            timer = timer - dt;
    7074            if(timer<=0){
    71                 afraid = false;
    72                 this->setNormal();
     75                setNormal();
    7376            }
    7477        }
     
    105108
    106109        for(PacmanPointAfraid* next : ObjectList<PacmanPointAfraid>()){
    107             if(collis(next->getPosition(), currentPosition)){
     110            if(next->taken(currentPosition)){
    108111                setAfraid();
    109112            }
     
    155158
    156159        //Change normal Ghosts with afraid ones
    157         if(afraid){
    158160            ghosts[4]->changewith(ghosts[0]);
    159161            ghosts[5]->changewith(ghosts[1]);
    160162            ghosts[6]->changewith(ghosts[2]);
    161163            ghosts[7]->changewith(ghosts[3]);
    162         }
    163164
    164165        afraid = false;
     
    198199    {
    199200        Deathmatch::start();
     201
     202        int i = 0;
     203        for(PacmanGhost* nextghost : ObjectList<PacmanGhost>()){
     204            if(3<i){
     205                nextghost->setPosition(0,-20,0);
     206                nextghost->dontmove =  true;
     207            };
     208           
     209            i++;
     210        }
    200211    }
    201212
Note: See TracChangeset for help on using the changeset viewer.