Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 17, 2018, 4:14:35 PM (7 years ago)
Author:
dreherm
Message:

HUD erweitert

File:
1 edited

Legend:

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

    r11958 r11976  
    4545
    4646       // firstGame = true;                   //needed for the HUD
    47         lives = 3;
     47        lives = 0;
    4848        point = 0;
    4949        level = 1;
     
    7777        SUPER(Pacman, tick, dt);
    7878
    79         //orxout() << timer << endl;
    80         //orxout() << afraid << endl;
    81         //orxout() << totallevelpoint << endl;
    82 
     79        if(deathtime != 0){
     80            dead(dt);
     81        }
     82
     83        else{
    8384
    8485        if(afraid){
    85             timer = timer - dt;
     86        timer = timer - dt;
    8687            if(timer<=0){
    8788                setNormal();
    8889            }
    8990        }
     91
    9092
    9193        int i = 0;
     
    109111
    110112        if(bcolli){
    111           this->catched();
     113          this->catched(dt);
    112114        }
    113115
     
    125127        }
    126128
     129        }
     130
     131
     132       
     133
    127134    }
    128135
     
    134141    }
    135142
    136     void Pacman::catched(){
     143    void Pacman::catched(float dt){
    137144
    138145    if(!afraid) {
    139         if(!lives) this->end();
     146        if(!lives){
     147          deathtime = 5;
     148          this->dead(dt); 
     149        }
    140150        --lives;
    141151        this->posreset();
     
    225235    }
    226236
     237    bool Pacman::isdead(){
     238        return death;
     239    }
     240
     241    void Pacman::dead(float dt){
     242        death = true;
     243
     244        deathtime = deathtime-dt;
     245
     246        if(deathtime<0)
     247            this->end();
     248    }
    227249
    228250    void Pacman::end()
Note: See TracChangeset for help on using the changeset viewer.