Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 4, 2018, 11:22:50 PM (7 years ago)
Author:
dreherm
Message:

Afraid Test 1

File:
1 edited

Legend:

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

    r11933 r11939  
    6565    {
    6666        SUPER(Pacman, tick, dt);
     67
     68        if(!timer){
     69            timer = timer - dt;
     70            if(timer<=0){
     71                afraid = false;
     72                timer = 0;
     73            }
     74        }
    6775
    6876        int i = 0;
     
    119127        }
    120128    else{
    121 
    122129        for(int nrghost = 0; nrghost<3; ++nrghost){
    123130        bcolli = collis(ghosts[nrghost]->getPosition(), currentPosition);
     
    130137    void setAfraid(){
    131138        afraid = true;
     139        timer = 10; //Set timer to 10 seconds
    132140    }
    133141
Note: See TracChangeset for help on using the changeset viewer.