Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 21, 2019, 2:19:16 PM (5 years ago)
Author:
ahuwyler
Message:

A new Game is born

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoBlox_FS19/src/modules/OrxoBlox/OrxoBloxBall.h

    r12210 r12212  
    5050        This class manages the ball for @ref orxonox::OrxoBlox "OrxoBlox".
    5151
    52         It is responsible for both the movement of the ball in the x,y-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::OrxoBloxCenterpoint "OrxoBloxCenterpoint") and the @ref orxonox::OrxoBloxBlocks "OrxoBloxBlocks". Or more precisely, it makes the ball bounce off then left and right delimiters of the playing field, it makes the ball bounce off the blocks, damages them and also detects when it reaches the lower bound and takes appropriate measures.
     52        It is responsible for both the movement of the ball in the x,z-plane as well as its interaction with the boundaries of the playing field (defined by the @ref orxonox::OrxoBloxCenterpoint "OrxoBloxCenterpoint") and the @ref orxonox::OrxoBloxBat "OrxoBloxBats". Or more precisely, it makes the ball bounce off then upper and lower delimiters of the playing field, it makes the ball bounce off the bats and also detects when a player scores and takes appropriate measures.
    5353
    5454    @author
     
    7676            /**
    7777            @brief Get the dimensions of the playing field.
    78             @param dimension A vector with the width as the first and height as the second                  component.
     78            @param dimension A vector with the width as the first and height as the second component.
    7979            */
    8080            void setFieldDimension(const Vector2& dimension)
     
    8282            /**
    8383            @brief Get the dimensions of the playing field.
    84             @return Returns a vector with the width as the first and height as the second                     component.
     84            @return Returns a vector with the width as the first and height as the second component.
    8585            */
    8686            Vector2 getFieldDimension() const
     
    109109
    110110            /**
    111             @brief Set the length of the blocks.
    112             @param batlength The length of the blocks (in x-direction) as percentage of the height                  of the playing field.
     111            @brief Set the length of the bats.
     112            @param batlength The length of the bats (in z-direction) as percentage of the height of the playing field.
    113113            */
    114             void setBlockLength(float blocklength)
    115                 { this->blocklength_ = blocklength; }
     114            void setBatLength(float batlength)
     115                { this->batlength_ = batlength; }
    116116            /**
    117             @brief Get the length of the blocks.
    118             @return Returns the length of the blocks as percentage of the height of the playing            field.
     117            @brief Get the length of the bats.
     118            @return Returns the length of the bats (in z-direction) as percentage of the height of the playing field.
    119119            */
    120             float getBlockLength() const
    121                 { return this->blocklength_; }
     120            float getBatLength() const
     121                { return this->batlength_; }
    122122
    123             void setBlock(WeakPtr<OrxoBloxBlock>* block); //!< Set the blocks for the ball.
    124             void applyBlock(); //!< Get the block over the network.
     123            void setBats(WeakPtr<OrxoBloxBat>* bats); //!< Set the bats for the ball.
     124            void applyBats(); //!< Get the bats over the network.
    125125
    126126            static const float MAX_REL_Z_VELOCITY;
     
    138138            float fieldWidth_; //!< The width of the playing field.
    139139            float fieldHeight_; //!< The height of the playing field.
    140             float speedX_; //!< The speed (in x-direction) of the ball.
    141             float speedY_; //!< The speed (in y-direction) of the ball.
     140            float speed_; //!< The speed (in x-direction) of the ball.
    142141            float accelerationFactor_; //!< The acceleration factor of the ball.
    143             float blocklength_; //!< The length of the bats (in z-direction) as percentage of the           height of the playing field.
    144             WeakPtr<OrxoBloxBlock>* block_; //!< An array with the blocks.
    145             bool bDeleteBlock_; //!< Bool, to keep track, of whether this->block_ exists or not.
    146             unsigned int* blockID_; //!< The object IDs of the blocks, to be able to synchronize                    them over the network.
     142            float batlength_; //!< The length of the bats (in z-direction) as percentage of the height of the playing field.
     143            WeakPtr<OrxoBloxBat>* bat_; //!< An array with the two bats.
     144            bool bDeleteBats_; //!< Bool, to keep track, of whether this->bat_ exists or not.
     145            unsigned int* batID_; //!< The object IDs of the bats, to be able to synchronize them over the network.
     146            float relMercyOffset_; //!< Offset, that makes the player not loose, when, in all fairness, he would have.
    147147            WorldSound* defScoreSound_;
    148148            WorldSound* defBatSound_;
Note: See TracChangeset for help on using the changeset viewer.