Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 12359


Ignore:
Timestamp:
May 9, 2019, 3:29:29 PM (6 years ago)
Author:
ahuwyler
Message:

fuer de jerome

Location:
code/branches/OrxoBlox_FS19
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw

    r12341 r12359  
    9191  <?lua include("includes/notifications.oxi") ?>
    9292
    93   <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true"/>
    94  
    9593
    9694  <Scene
     
    105103
    106104
    107     <MovableEntity rotationrate=0 rotationaxis="0,0,1">
     105    <OrxoBloxCenterpoint name=OrxoBloxcenter dimension="90,100" balltemplate=OrxoBloxball battemplate=OrxoBloxbat ballspeed=200 ballaccfactor=1.0 batspeed=130 batlength=0.25 StoneTemplate=OrxoBloxstone WallTemplate=OrxoBloxwall position="-55,-75,0">
     106       
    108107      <attached>
    109         <OrxoBloxCenterpoint name=OrxoBloxcenter dimension="90,100" balltemplate=OrxoBloxball battemplate=OrxoBloxbat ballspeed=200 ballaccfactor=1.0 batspeed=130 batlength=0.25 StoneTemplate=OrxoBloxstone WallTemplate=OrxoBloxwall>
    110        
    111           <attached>
    112108            <!-- Balken die das Spielfeld begrenzen. -->
    113             <Model position="0,0,-49" mesh="cube.mesh" scale3D="45,1,1" />
    114             <Model position="46,0,0" mesh="cube.mesh" scale3D="1,1,50"/>
    115             <Model position="-46,0,0" mesh="cube.mesh" scale3D="1,1,50"/>
    116           </attached>
    117         </OrxoBloxCenterpoint>
     109          <Model position="0,0,-49" mesh="cube.mesh" scale3D="45,1,1" />
     110          <Model position="46,0,0" mesh="cube.mesh" scale3D="1,1,50"/>
     111          <Model position="-46,0,0" mesh="cube.mesh" scale3D="1,1,50"/>
    118112      </attached>
    119     </MovableEntity>   
     113    </OrxoBloxCenterpoint>
     114     
    120115  </Scene>
    121116</Level>
  • code/branches/OrxoBlox_FS19/data/overlays/OrxoBloxHUD.oxo

    r12268 r12359  
    22  <OverlayGroup name="OrxoBloxHUD" scale = "1, 1">
    33    <OrxoBloxScore
    4      position  = "0.05, 0.05"
     4     position  = "0.9, 0.2"
    55     pickpoint = "0.0, 0.0"
    66     font      = "ShareTechMono"
    7      textsize  = 0.06
     7     textsize  = 0.05
     8     colour    = "1.0, 1.0, 1.0, 1.0"
     9     align     = "left"
     10    />
     11
     12    <OverlayText
     13     position  = "0.7, 0.20"
     14     pickpoint = "0.0, 0.0"
     15     font      = "ShareTechMono"
     16     textsize  = 0.05
    817     colour    = "1.0, 1.0, 1.0, 1.0"
    918     align     = "left"
    1019
    11      showleftplayer  = true
    12      showrightplayer = false
    13      showname        = true
    14      showscore       = false
     20     caption   = "Points: "
    1521    />
    1622
    17     <OrxoBloxScore
    18      position  = "0.49, 0.05"
    19      pickpoint = "0.0, 0.0"
    20      font      = "ShareTechMono"
    21      textsize  = 0.06
    22      colour    = "1.0, 1.0, 1.0, 1.0"
    23      align     = "right"
    24 
    25      showleftplayer  = true
    26      showrightplayer = false
    27      showname        = false
    28      showscore       = true
    29     />
    30 
    31     <OverlayText
    32      position  = "0.505, 0.05"
    33      pickpoint = "0.0, 0.0"
    34      font      = "ShareTechMono"
    35      textsize  = 0.06
    36      colour    = "1.0, 1.0, 1.0, 1.0"
    37      align     = "center"
    38 
    39      caption   = ":"
    40     />
    41 
    42     <OrxoBloxScore
    43      position  = "0.51, 0.05"
    44      pickpoint = "0.0, 0.0"
    45      font      = "ShareTechMono"
    46      textsize  = 0.06
    47      colour    = "1.0, 1.0, 1.0, 1.0"
    48      align     = "left"
    49 
    50      showleftplayer  = false
    51      showrightplayer = true
    52      showname        = false
    53      showscore       = true
    54     />
    55 
    56     <OrxoBloxScore
    57      position  = "0.95, 0.05"
    58      pickpoint = "0.0, 0.0"
    59      font      = "ShareTechMono"
    60      textsize  = 0.06
    61      colour    = "1.0, 1.0, 1.0, 1.0"
    62      align     = "right"
    63 
    64      showleftplayer  = false
    65      showrightplayer = true
    66      showname        = true
    67      showscore       = false
    68     />
    6923  </OverlayGroup>
    7024</Template>
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.cc

    r12355 r12359  
    170170
    171171        // Set variable to temporarily force the player to spawn.
     172        // Set variable to temporarily force the player to spawn.
     173        bool temp = this->bForceSpawn_;
    172174        this->bForceSpawn_ = true;
    173175
     
    175177        Deathmatch::start();
    176178
     179        // Reset the variable.
     180        this->bForceSpawn_ = temp;
     181
    177182    }
    178183
     
    184189    {
    185190        ChatManager::message("You suck!!");
     191
     192        if (Highscore::exists())
     193        {
     194            int score = this->getScore(this->getPlayer());
     195            Highscore::getInstance().storeScore("Tetris", score, this->getPlayer());
     196        }
     197
    186198        this->cleanup();
    187199
     
    191203    }
    192204
    193     OrxoBloxShip* OrxoBlox::getPlayer()
    194     {
    195         if (playership == nullptr)
    196         {
    197             for (OrxoBloxShip* ship_ : ObjectList<OrxoBloxShip>())
    198             {
    199                 playership = ship_;
    200             }
    201         }
    202         return playership;
     205    PlayerInfo* OrxoBlox::getPlayer()
     206    {
     207        return this->player_;
    203208    }
    204209   
     
    217222    void OrxoBlox::LevelUp(){
    218223        level_++;
    219 
     224        this->playerScored(this->player_);// add points
    220225        for(OrxoBloxStones* stone : this->stones_){
    221226            int x_=(stone->getPosition()).x;
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBlox.h

    r12346 r12359  
    7373            virtual void end() override; ///!< Ends the OrxoBlox minigame.
    7474
    75             OrxoBloxShip* getPlayer();
     75            PlayerInfo* getPlayer();
    7676            void spawnPlayer(PlayerInfo* Player) override;
    7777
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxPrereqs.h

    r12331 r12359  
    7474    class OrxoBloxStones;
    7575    class OrxoBloxShip;
     76    class OrxoBloxScore;
    7677}
    7778
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxScore.cc

    r12266 r12359  
    3535
    3636#include "core/CoreIncludes.h"
    37 #include "core/XMLPort.h"
    3837#include "util/Convert.h"
    3938
     
    4140
    4241#include "OrxoBlox.h"
    43 #include "sound/WorldSound.h" /////////////////////////////
    4442
    4543namespace orxonox
     
    5654
    5755        this->owner_ = nullptr;
    58 
    59         this->bShowName_ = true;
    60         this->bShowScore_ = true;
    61         this->bShowPlayer_ = true;
    62     }
     56        this->player_ = nullptr;
    6357
    6458    /**
     
    7064    }
    7165
    72     /**
    73     @brief
    74         Method to create a OrxoBloxScore through XML.
    75     */
    76     void OrxoBloxScore::XMLPort(Element& xmlelement, XMLPort::Mode mode)
    77     {
    78         SUPER(OrxoBloxScore, XMLPort, xmlelement, mode);
    79 
    80         XMLPortParam(OrxoBloxScore, "showname",        setShowName,        getShowName,        xmlelement, mode).defaultValues(false);
    81         XMLPortParam(OrxoBloxScore, "showscore",       setShowScore,       getShowScore,       xmlelement, mode).defaultValues(false);
    82         XMLPortParam(OrxoBloxScore, "showplayer",  setShowPlayer,  getShowPlayer,  xmlelement, mode).defaultValues(false);
    83     }
    84 
     66   
    8567    /**
    8668    @brief
     
    9779        if (this->owner_ != nullptr)
    9880        {
    99             if (!this->owner_->hasEnded())
     81            std::string score("0");
     82            if(!this->owner_->hasEnded())
    10083            {
    101                 // Get the player.
    102                 //Fehlermeldung
    103                 //player1_ = this->owner_->getPlayer();
     84                //get the player
     85                player_ = this->owner_->getPlayer();
    10486            }
    10587
    106             std::string name1;
    107 
    108             std::string score1("0");
    109 
    110             // Save the name and score of each player as a string.
    111             if (player1_ != nullptr)
     88            if(this->owner_->hasStarted())
    11289            {
    113                 name1 = player1_->getName();
    114                 score1 = multi_cast<std::string>(this->owner_->getScore(player1_));
     90                // Save the name and score of each player as a string.
     91                if (player_ != nullptr)
     92                    score = multi_cast<std::string>(this->owner_->getScore(player_));
    11593            }
    116 
    117             // Assemble the strings, depending on what should all be displayed.
    118             std::string output1;
    119             if (this->bShowPlayer_)
    120             {
    121                 if (this->bShowName_ && this->bShowScore_ && player1_ != nullptr)
    122                     output1 = name1 + " - " + score1;
    123                 else if (this->bShowScore_)
    124                     output1 = score1;
    125                 else if (this->bShowName_)
    126                     output1 = name1;
    127             }
    128 
    129             std::string output("OrxoBlox");
    130             /* Keine Ahnung wofuer das gut ist.
    131 
    132             if (this->bShowName_ || this->bShowScore_)
    133             {
    134                 if (this->bShowLeftPlayer_ && this->bShowRightPlayer_)
    135                     output = output1 + ':' + output2;
    136                 else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_)
    137                     output = output1 + output2;
    138             }*/
    139 
    140             this->setCaption(output);
     94            this->setCaption(score);
    14195        }
    14296    }
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxScore.h

    r12266 r12359  
    6161
    6262            virtual void tick(float dt) override; //!< Creates and sets the caption to be displayed by the OrxoBloxScore.
    63             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
    6463            virtual void changedOwner() override; //!< Is called when the owner changes.
    6564
    66             /**
    67             @brief Set whether the OrxoBloxScore displays the players' names.
    68             @param value If true the players' names are displayed.
    69             */
    70             inline void setShowName(bool value)
    71                 { this->bShowName_ = value; }
    72             /**
    73             @brief Get whether the OrxoBloxScore displays the players' names.
    74             @return Returns true if the players' names are displayed, false otherwise.
    75             */
    76             inline bool getShowName() const
    77                 { return this->bShowName_; }
    7865
    79             /**
    80             @brief Set whether the OrxoBloxScore displays the players' scores.
    81             @param value If true the players' scores are displayed.
    82             */
    83             inline void setShowScore(bool value)
    84                 { this->bShowScore_ = value; }
    85             /**
    86             @brief Get whether the OrxoBloxScore displays the players' scores.
    87             @return Returns true if the players' scores are displayed, false otherwise.
    88             */
    89             inline bool getShowScore() const
    90                 { return this->bShowScore_; }
    91 
    92             /**
    93             @brief Set whether the OrxoBloxScore displays the left player.
    94             @param value If true the left player is displayed.
    95             */
    96             inline void setShowPlayer(bool value)
    97                 { this->bShowPlayer_ = value; }
    98             /**
    99             @brief Get whether the OrxoBloxScore displays the left player.
    100             @return Returns true if the left player is displayed, false otherwise.
    101             */
    102             inline bool getShowPlayer() const
    103                 { return this->bShowPlayer_; }
    104 
    105 /*
    106             /**
    107             @brief Set whether the OrxoBloxScore displays the right player.
    108             @param value If true the right player is displayed.
    109            
    110             inline void setShowRightPlayer(bool value)
    111                 { this->bShowRightPlayer_ = value; }
    112             /**
    113             @brief Get whether the OrxoBloxScore displays the right player.
    114             @return Returns true if the right player is displayed, false otherwise.
    115            
    116             inline bool getShowRightPlayer() const
    117                 { return this->bShowRightPlayer_; }
    118 */
    11966        private:
    12067            OrxoBlox* owner_; //!< The OrxoBlox game that owns this OrxoBloxScore.
    121             bool bShowName_; //!< Whether the names of the players are shown.
    122             bool bShowScore_; //!< Whether the score of the players is shown.
    123             bool bShowPlayer_; //!< Whether the left player is shown.
    124             //bool bShowRightPlayer_; //!< Whether the right player is shown.
    125             WeakPtr<PlayerInfo> player1_; //!< Store information about left player permanently.
    126             WeakPtr<PlayerInfo> player2_; //!< Same for the right player. To end the game properly.
    127             WorldSound* scoreSound_;
    128 
     68            PlayerInfo* player_; //!< Store information about the player permanently.
    12969    };
    13070}
Note: See TracChangeset for help on using the changeset viewer.