Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11976


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

HUD erweitert

Location:
code/branches/3DPacman_FS18
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • code/branches/3DPacman_FS18/data/levels/3DPacman.oxw

    r11961 r11976  
    17701770
    17711771  <!-- Edge --> 
    1772   <BoxCollisionShape position="250,30,0" halfExtents="15,15,250" />
    1773   <BoxCollisionShape position="-250,30,0" halfExtents="15,15,250" />
    1774   <BoxCollisionShape position="0,30,250" halfExtents="250,15,15" />
    1775   <BoxCollisionShape position="0,30,-250" halfExtents="250,15,15" />
     1772  <BoxCollisionShape position="250,10,0" halfExtents="15,15,250" />
     1773  <BoxCollisionShape position="-250,10,0" halfExtents="15,15,250" />
     1774  <BoxCollisionShape position="0,10,250" halfExtents="250,15,15" />
     1775  <BoxCollisionShape position="0,10,-250" halfExtents="250,15,15" />
    17761776
    17771777   <!-- Shapes in order -->   
    1778   <BoxCollisionShape position="-200,30,-65" halfExtents="55,15,35" />
    1779   <BoxCollisionShape position="-200,30,30" halfExtents="55,15,35" />
    1780   <BoxCollisionShape position="200,30,-65" halfExtents="55,15,35" />
    1781   <BoxCollisionShape position="200,30,30" halfExtents="55,15,35" />
    1782   <BoxCollisionShape position="-175,30,-195" halfExtents="30,15,20" /> <!-- 5 --> 
    1783   <BoxCollisionShape position="-80,30,-195" halfExtents="40,15,20" />
    1784   <BoxCollisionShape position="-175,30,-140" halfExtents="30,15,10" />
    1785   <BoxCollisionShape position="0,30,-210" halfExtents="10,15,30" />
    1786   <BoxCollisionShape position="80,30,-195" halfExtents="40,15,20" />
    1787   <BoxCollisionShape position="175,30,-195" halfExtents="30,15,20" /> <!-- 10 -->
    1788   <BoxCollisionShape position="175,30,-140" halfExtents="30,15,10" />
    1789   <BoxCollisionShape position="0,30,-140" halfExtents="60,15,10" />
    1790   <BoxCollisionShape position="0,30,-110" halfExtents="10,15,25" />
    1791   <BoxCollisionShape position="-100,30,-90" halfExtents="10,15,60" />
    1792   <BoxCollisionShape position="-70,30,-90" halfExtents="25,15,10" /> <!-- 15 -->
    1793   <BoxCollisionShape position="100,30,-90" halfExtents="10,15,60" />
    1794   <BoxCollisionShape position="70,30,-90" halfExtents="25,15,10" />
    1795   <BoxCollisionShape position="0,30,-20" halfExtents="60,15,35" />
    1796   <BoxCollisionShape position="-100,30,30" halfExtents="10,15,35" />
    1797   <BoxCollisionShape position="0,30,50" halfExtents="60,15,10" /> <!-- 20 -->
    1798   <BoxCollisionShape position="0,30,80" halfExtents="10,15,25" />
    1799   <BoxCollisionShape position="100,30,30" halfExtents="10,15,35" />
    1800   <BoxCollisionShape position="-175,30,100" halfExtents="30,15,10" />
    1801   <BoxCollisionShape position="-155,30,130" halfExtents="10,15,25" />
    1802   <BoxCollisionShape position="-75,30,100" halfExtents="35,15,10" /> <!-- 25 -->
    1803   <BoxCollisionShape position="75,30,100" halfExtents="35,15,10" />
    1804   <BoxCollisionShape position="175,30,100" halfExtents="30,15,10" />
    1805   <BoxCollisionShape position="155,30,130" halfExtents="10,15,25" />
    1806   <BoxCollisionShape position="-220,30,150" halfExtents="20,15,10" />
    1807   <BoxCollisionShape position="-220,30,150" halfExtents="20,15,10" /> <!-- 30 -->
    1808   <BoxCollisionShape position="0,30,150" halfExtents="60,15,10" />
    1809   <BoxCollisionShape position="0,30,180" halfExtents="10,15,25" />
    1810   <BoxCollisionShape position="-100,30,170" halfExtents="10,15,25" />
    1811   <BoxCollisionShape position="-125,30,200" halfExtents="80,15,10" />
    1812   <BoxCollisionShape position="100,30,170" halfExtents="10,15,25" /> <!-- 35 -->
    1813   <BoxCollisionShape position="125,30,200" halfExtents="80,15,10" />
     1778  <BoxCollisionShape position="-200,10,-65" halfExtents="55,30,35" />
     1779  <BoxCollisionShape position="-200,10,30" halfExtents="55,30,35" />
     1780  <BoxCollisionShape position="200,10,-65" halfExtents="55,30,35" />
     1781  <BoxCollisionShape position="200,10,30" halfExtents="55,30,35" />
     1782  <BoxCollisionShape position="-175,10,-195" halfExtents="30,30,20" /> <!-- 5 --> 
     1783  <BoxCollisionShape position="-80,10,-195" halfExtents="40,30,20" />
     1784  <BoxCollisionShape position="-175,10,-140" halfExtents="30,30,10" />
     1785  <BoxCollisionShape position="0,10,-210" halfExtents="10,30,30" />
     1786  <BoxCollisionShape position="80,10,-195" halfExtents="40,30,20" />
     1787  <BoxCollisionShape position="175,10,-195" halfExtents="30,30,20" /> <!-- 10 -->
     1788  <BoxCollisionShape position="175,10,-140" halfExtents="30,30,10" />
     1789  <BoxCollisionShape position="0,10,-140" halfExtents="60,30,10" />
     1790  <BoxCollisionShape position="0,10,-110" halfExtents="10,30,25" />
     1791  <BoxCollisionShape position="-100,10,-90" halfExtents="10,30,60" />
     1792  <BoxCollisionShape position="-70,10,-90" halfExtents="25,30,10" /> <!-- 15 -->
     1793  <BoxCollisionShape position="100,10,-90" halfExtents="10,30,60" />
     1794  <BoxCollisionShape position="70,10,-90" halfExtents="25,30,10" />
     1795  <BoxCollisionShape position="0,10,-20" halfExtents="60,30,35" />
     1796  <BoxCollisionShape position="-100,10,30" halfExtents="10,30,35" />
     1797  <BoxCollisionShape position="0,10,50" halfExtents="60,30,10" /> <!-- 20 -->
     1798  <BoxCollisionShape position="0,10,80" halfExtents="10,30,25" />
     1799  <BoxCollisionShape position="100,10,30" halfExtents="10,30,35" />
     1800  <BoxCollisionShape position="-175,10,100" halfExtents="30,30,10" />
     1801  <BoxCollisionShape position="-155,10,130" halfExtents="10,30,25" />
     1802  <BoxCollisionShape position="-75,10,100" halfExtents="35,30,10" /> <!-- 25 -->
     1803  <BoxCollisionShape position="75,10,100" halfExtents="35,30,10" />
     1804  <BoxCollisionShape position="175,10,100" halfExtents="30,30,10" />
     1805  <BoxCollisionShape position="155,10,130" halfExtents="10,30,25" />
     1806  <BoxCollisionShape position="-220,10,150" halfExtents="20,30,10" />
     1807  <BoxCollisionShape position="-220,10,150" halfExtents="20,30,10" /> <!-- 30 -->
     1808  <BoxCollisionShape position="0,10,150" halfExtents="60,30,10" />
     1809  <BoxCollisionShape position="0,10,180" halfExtents="10,30,25" />
     1810  <BoxCollisionShape position="-100,10,170" halfExtents="10,30,25" />
     1811  <BoxCollisionShape position="-125,10,200" halfExtents="80,30,10" />
     1812  <BoxCollisionShape position="100,10,170" halfExtents="10,30,25" /> <!-- 35 -->
     1813  <BoxCollisionShape position="125,10,200" halfExtents="80,30,10" />
    18141814
    18151815
  • code/branches/3DPacman_FS18/data/overlays/PacmanHUD.oxo

    r11961 r11976  
    2525
    2626    <PacmanHUDinfo
     27     position  = "1.4, 2.5"
     28     pickpoint = "0.0, 0.0"
     29     font      = "ShareTechMono"
     30     textsize  = 0.04
     31     colour    = "1.0, 1.0, 1.0, 1.0"
     32     align     = "right"
     33
     34    />
     35
     36    <PacmanHUDinfo
    2737     position  = "0.4, 0.1"
    2838     pickpoint = "0.0, 0.0"
     
    3242     align     = "right"
    3343
    34      showghoststatus     = true
     44     showghoststatus   = true
    3545    />
    3646
  • 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()
  • code/branches/3DPacman_FS18/src/modules/pacman/Pacman.h

    r11956 r11976  
    7575            void levelUp();
    7676            bool collis(Vector3 one, Vector3 other);
    77             void catched();
     77            void catched(float dt);
    7878            void posreset();
    7979            void takePoint(PacmanPointSphere* taken);
     
    8282            void setAfraid();
    8383            void setNormal();
     84            bool isdead();
     85            void dead(float dt);
    8486
    8587
     
    100102            //bool firstGame;
    101103            bool afraid = false;
     104            bool death = false;
     105            float deathtime = 0;
    102106           
    103107       private:
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc

    r11959 r11976  
    439439
    440440    void PacmanGhost::move(float dt, Vector3 actuelposition, Vector3 velocity){
    441         if(!dontmove)
     441        if(!dontmove){
    442442            this->setPosition(Vector3(actuelposition.x+20*velocity.x*dt,10,actuelposition.z+20*velocity.z*dt));
     443           
     444
     445            if(abs(velocity.x) == 2){
     446                this->setOrientation(Quaternion(Radian(0), Vector3(0, 1, 0)));
     447            }
     448            else if(velocity.z == 2){
     449                this->setOrientation(Quaternion(Radian(0), Vector3(0, 1, 0)));
     450            }
     451            else if(velocity.z == -2){
     452                this->setOrientation(Quaternion(Radian(180), Vector3(0, 1, 0)));
     453            }
     454            else{}
     455
     456     }
    443457    }
    444458
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.cc

    r11961 r11976  
    6868        if (this->PacmanGame)
    6969        {
    70                 if(this->bShowPoints_){
     70            bool death = this->PacmanGame->isdead();
     71            if(death){
     72                bShowPoints_ = false;
     73                bShowGhoststatus_ = false;
     74                const std::string& deathmessage = "Game Over";
     75                    setTextSize(0.4);
     76                    this->setCaption(deathmessage);
     77            }
     78           
     79            if(this->bShowPoints_ && !death) {
    7180                    const std::string& points = "Collected points: "+multi_cast<std::string>(this->PacmanGame->getPoints()) + " of " + multi_cast<std::string>(this->PacmanGame->totallevelpoint);
    7281                    setTextSize(0.04);
    7382                    this->setCaption(points);
    74                 }
    75                 if(this->bShowGhoststatus_){
     83            }
     84 
     85            if(this->bShowGhoststatus_ && !death){
    7686                    const std::string& ghoststatus = "Do not get caught!";
    77                     //if(this->PacmanGame->afraid) const std::string& ghoststatus = "Catch the ghosts!";
    78                     orxout() << "Test Hier" << endl;
     87                    if(this->PacmanGame->afraid) const std::string& ghoststatus = "Catch the ghosts!";
    7988                    setTextSize(0.04);
    8089                    this->setCaption(ghoststatus);
    81                 }
     90            }
    8291        }
    8392    }   
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.h

    r11961 r11976  
    6363                { return messageID; }
    6464
    65             inline void setGhoststatus(int value){
     65            inline void setGhoststatus(bool value){
    6666                this->bShowGhoststatus_ = value;
    6767            }
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanPointAfraid.cc

    r11956 r11976  
    7575    {
    7676        resetposition = this->getPosition();
    77       if((abs(resetposition.x - playerpos.x)<1) && (abs(resetposition.z - playerpos.z)<1)){
     77      if((abs(resetposition.x - playerpos.x)<5) && (abs(resetposition.z - playerpos.z)<5)){
    7878        this->setPosition(Vector3(resetposition.x, -50, resetposition.z));
    7979        return true;
Note: See TracChangeset for help on using the changeset viewer.