Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11958


Ignore:
Timestamp:
May 13, 2018, 12:39:06 AM (6 years ago)
Author:
dreherm
Message:

HUD test 1

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

Legend:

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

    r11957 r11958  
    88<?lua
    99  include("stats.oxo")
    10   include("HUDTemplates3.oxo")
     10  include("PacmanHUD.oxo")
    1111  include("templates/lodInformation.oxt")
    1212?>
  • code/branches/3DPacman_FS18/data/overlays/PacmanHUD.oxo

    r11931 r11958  
    1 <Template name="pacmanhud">
    2   <OverlayGroup name = "pacmanhud" scale = "1, 1">
     1<Template name="spectatorhud">
     2  <OverlayGroup name = "spectator" scale = "1, 1">
    33  </OverlayGroup>
    44</Template>
     
    1616     showpoints     = true
    1717    />
    18 
    19     <PacmanHUDinfo
    20      position  = "0.5, 0.5"
    21      pickpoint = "0.0, 0.0"
    22      font      = "ShareTechMono"
    23      textsize  = 0.04
    24      colour    = "1.0, 0.0, 0.0, 1.0"
    25      align     = "center"
    26 
    27      showmessage     = true
    28      messageID = 0
    29 
    30     />
    31 
    32     <PacmanHUDinfo
    33          position  = "0.5, 0.6"
    34          pickpoint = "0.0, 0.0"
    35          font      = "ShareTechMono"
    36          textsize  = 0.04
    37          colour    = "1.0, 1.0, 1.0, 1.0"
    38          align     = "center"
    39 
    40          showmessage     = true
    41          messageID = 1
    42     />
    43     <PacmanHUDinfo
    44      position  = "0.5, 0.65"
    45      pickpoint = "0.0, 0.0"
    46      font      = "ShareTechMono"
    47      textsize  = 0.04
    48      colour    = "1.0, 1.0, 1.0, 1.0"
    49      align     = "center"
    50 
    51      showmessage     = true
    52      messageID = 2
    53     />
    54     <PacmanHUDinfo
    55      position  = "0.5, 0.7"
    56      pickpoint = "0.0, 0.0"
    57      font      = "ShareTechMono"
    58      textsize  = 0.04
    59      colour    = "1.0, 1.0, 1.0, 1.0"
    60      align     = "center"
    61 
    62      showmessage     = true
    63      messageID = 3
    64 
    65     />
    66 
    6718   
    6819  </OverlayGroup>
  • code/branches/3DPacman_FS18/src/modules/pacman/CMakeLists.txt

    r11939 r11958  
    55  PacmanPointSphere.cc
    66  PacmanPointAfraid.cc
     7  PacmanHUDinfo.cc
    78)
    89
  • code/branches/3DPacman_FS18/src/modules/pacman/Pacman.cc

    r11956 r11958  
    5555    void Pacman::levelUp()
    5656    {
    57         this->end();
     57        for(PacmanPointSphere* nextsphere : ObjectList<PacmanPointSphere>()){
     58                nextsphere->resetPacmanPointSphere();
     59        }
     60
     61        for(PacmanPointAfraid* next : ObjectList<PacmanPointAfraid>()){
     62            next->resetPacmanPointAfraid();
     63        }
     64
     65        for(PacmanGhost* nextghost : ObjectList<PacmanGhost>()){
     66            nextghost->levelupvelo();
     67        }
     68        this->posreset();
    5869    }
    5970
     
    217228    void Pacman::end()
    218229    {
    219         /*
    220         firstGame = false;
    221        
    222         //Set randomized deathmessages
    223         if(point<7)         sDeathMessage = DeathMessage7[rand()%(DeathMessage7.size())];
    224         else if(point<20)   sDeathMessage = DeathMessage20[rand()%(DeathMessage20.size())];
    225         else if(point<30)   sDeathMessage = DeathMessage30[rand()%(DeathMessage30.size())];
    226         else                sDeathMessage = DeathMessageover30[rand()%(DeathMessageover30.size())];
    227        
    228         //Update Highscore
    229         if (Highscore::exists())
    230         {
    231             int score = this->getPoints();
    232             Highscore::getInstance().storeScore("Pacman", score, this->getPlayer()->getPlayer());
    233         }
    234 
    235 
     230
     231        /*
    236232        if (Highscore::exists())
    237233        {
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.cc

    r11952 r11958  
    466466   
    467467    }
     468
     469    void levelupvelo(){
     470        velocity.x = velocity.x + 2;
     471        velocity.y = velocity.y + 2;
     472        velocity.z = velocity.z + 2;
     473    }
    468474}
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanGhost.h

    r11951 r11958  
    5656            void setnewTarget(int firstdec, int seconddec, int thirddec, int fourthdec);
    5757            void changewith(PacmanGhost* otherghost);
     58            void levelupvelo();
    5859
    5960            bool findpos(Vector3 one, Vector3 other);     
     
    6566            bool ismoving = false;
    6667            int target_x = 0;
    67             int target_z = 0;
     68            int target_z = 0;
     69            Vector3 velocity;
    6870
    6971        private:
    7072            int decision = 0; //Gives the random which way information to the ghost.
    71             Vector3 velocity;
    7273            Vector3 resetposition = Vector3(0,10,15);
    7374    };
  • code/branches/3DPacman_FS18/src/modules/pacman/PacmanHUDinfo.cc

    r11931 r11958  
    6565        if (this->PacmanGame)
    6666        {
    67             if(not this->PacmanGame->isDead()){
    6867                if(this->bShowPoints_){
    6968                    const std::string& points = "Score: "+multi_cast<std::string>(this->PacmanGame->getPoints());
     
    7170                    this->setCaption(points);
    7271                }
    73                 else if(this->bShowMessage_){
    74                     setTextSize(0);
    75                 }
    76             }
    77             else{
    78                 if(this->bShowPoints_){
    79                     setTextSize(0);
    80                 }
    81                 else if(this->bShowMessage_){
    82                     if(this->PacmanGame->firstGame){
    83                         if(messageID==3){
    84                             setTextSize(0.05);
    85                             this->setCaption("First click, then press space to start");
    86                         }
    87                     }
    88                     else{
    89                         std::string message;
    90                         setTextSize(0.05);
    91                         switch(messageID){
    92                             case 0:
    93                                 message = "Game Over";
    94                                 setTextSize(0.1);
    95                                 this->setCaption(message);
    96                             break;
    97                             case 1:
    98                                 message = this->PacmanGame->sDeathMessage;
    99                             break;
    100                             case 2:
    101                                 message = "Your Score: "+multi_cast<std::string>(this->PacmanGame->getPoints())+
    102                                                         "  Local High Score: "+multi_cast<std::string>(Highscore::getInstance().getHighestScoreOfGame("Flappy Orx"));
    103                             break;
    104                             case 3:
    105                                 time_t time = this->PacmanGame->getPlayer()->timeUntilRespawn();
    106                                 if(time<=0)
    107                                     message = "Press space to restart.";
    108                                 else
    109                                     message = "Please wait "+multi_cast<std::string>(time)+" seconds.";
    110                             break;
    111                         }
    112                         this->setCaption(message);
    113                     }
    114                 }
    115             }   
    11672        }
    117     }
     73    }   
    11874
    11975    void PacmanHUDinfo::changedOwner()
Note: See TracChangeset for help on using the changeset viewer.