Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 23, 2011, 12:13:34 PM (13 years ago)
Author:
dafrick
Message:

More documentation for Pong.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/tetris/src/modules/pong/PongBall.cc

    r8104 r8105  
    101101    @brief
    102102        Is called every tick.
    103         //TODO: Explain in detail what happens here.
     103        Handles the movement of the ball and its interaction with the boundaries and bats.
    104104    @param dt
    105105        The time since the last tick.
     
    226226    /**
    227227    @brief
    228         Set the
     228        Set the bats for the ball.
     229    @param bats
     230        An array (of size 2) of weak pointers, to be set as the new bats.
    229231    */
    230232    void PongBall::setBats(WeakPtr<PongBat>* bats)
    231233    {
    232         if (this->bDeleteBats_)
     234        if (this->bDeleteBats_) // If there are already some bats, delete them.
    233235        {
    234236            delete[] this->bat_;
     
    237239
    238240        this->bat_ = bats;
     241        // Also store their object IDs, for synchronization.
    239242        this->batID_[0] = this->bat_[0]->getObjectID();
    240243        this->batID_[1] = this->bat_[1]->getObjectID();
    241244    }
    242245
     246    /**
     247    @brief
     248        Get the bats over the network.
     249    */
    243250    void PongBall::applyBats()
    244251    {
    245         if (!this->bat_)
     252        // Make space for the bats, if they don't exist, yet.
     253        if (this->bat_ == NULL)
    246254        {
    247255            this->bat_ = new WeakPtr<PongBat>[2];
Note: See TracChangeset for help on using the changeset viewer.