Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 23, 2011, 6:22:47 PM (14 years ago)
Author:
dafrick
Message:

And even more documentation.
Also moved some of the documentation out of Groups.dox into seperate files located in the new groups folder.

Location:
code/branches/tetris/src/modules/pong
Files:
8 edited

Legend:

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

    r8104 r8106  
    3737#include "core/EventIncludes.h"
    3838#include "core/command/Executor.h"
     39
     40#include "gamestates/GSLevel.h"
    3941
    4042#include "PongCenterpoint.h"
     
    158160            this->ball_->setBats(this->bat_);
    159161        }
    160         else // If no centerpoint was specified, an error is thrown.
     162        else // If no centerpoint was specified, an error is thrown and the level is exited.
    161163        {
    162164            COUT(1) << "Error: No Centerpoint specified." << std::endl;
    163             // TODO: End the game?
     165            GSLevel::startMainMenu();
     166            return;
    164167        }
    165168
     
    210213        Spawns the input player.
    211214    @param player
    212         The player tp be spawned.
     215        The player to be spawned.
    213216    */
    214217    void Pong::spawnPlayer(PlayerInfo* player)
  • code/branches/tetris/src/modules/pong/Pong.h

    r8105 r8106  
    4747    /**
    4848    @brief
    49         Implements a Pong minigame.
     49        Implements a Pong minigame (<a href="http://en.wikipedia.org/wiki/Pong">Wikipedia::Pong</a>).
    5050        It connects the different entities present in a game of Pong.
    51        
    52         //TODO: List and add details to different classes used and how.
    53         PongBall, is the ball, PongBats are the things that can be moved by the players (ControllableEntities), PongCenterpoint is the playing field. (x-z area)
     51
     52        - The @ref orxonox::PongCenterpoint "PongCenterpoint" is the playing field for the Pong minigame, it allows for configuration of the minigame, e.g. by setting the size of the playing field, or the length of the @ref orxonox::PongBat "PongBats". The playing field is always in the x,y-plane, the x-axis being the horizontal and the z-axis being the vertical axis.<br />
     53        The Pong class redistributes the important parameters defined in @ref orxonox::PongCenterpoint "PongCenterpoint" to the other entities, that need to know them, e.g. the @ref orxonox::PongBall "PongBall" and the @ref orxonox::PongBat "PongBats".<br />
     54        The @ref orxonox::PongCenterpoint "PongCenterpoint" needs to exist in a level with the @ref orxonox::Gametype "Gametype" <em>Pong</em>.
     55        - The @ref orxonox::PongBall "PongBall" is the ball both players play with. The @ref orxonox::PongBall "PongBall" both implements the movement of the ball, as well as the influence of the boundaries and consequently, also the bouncing (off the upper and lower delimiters, and as off the @ref orxonox::PongBat "PongBats") of the ball and the effects of the failure of a player to catch the ball (i.e. the scoring of the other player).
     56        - The two @ref orxonox::PongBat "PongBats" are the entities through which the players can actively participate in the game, by controlling them. The @ref orxonox::PongBat "PongBat" class manages the movement (and restrictions thereof) and the influence of the players on the bats.
    5457
    5558    @author
  • code/branches/tetris/src/modules/pong/PongBall.cc

    r8105 r8106  
    144144                        // Set the ball to be exactly at the boundary.
    145145                        position.x = this->fieldWidth_ / 2;
    146                         // Invert its veloxity in x-direction (i.e. it bounces off).
     146                        // Invert its velocity in x-direction (i.e. it bounces off).
    147147                        velocity.x = -velocity.x;
    148148                        // Adjust the velocity in the z-direction, depending on where the ball hit the bat.
     
    171171                        // Set the ball to be exactly at the boundary.
    172172                        position.x = -this->fieldWidth_ / 2;
    173                         // Invert its veloxity in x-direction (i.e. it bounces off).
     173                        // Invert its velocity in x-direction (i.e. it bounces off).
    174174                        velocity.x = -velocity.x;
    175175                        // Adjust the velocity in the z-direction, depending on where the ball hit the bat.
  • code/branches/tetris/src/modules/pong/PongBall.h

    r8105 r8106  
    121121            void applyBats(); //!< Get the bats over the network.
    122122
    123             // TODO: What is this exactly?
    124123            static const float MAX_REL_Z_VELOCITY;
    125124
     
    133132            float batlength_; //!< The length of the bats (in z-direction) as percentage of the height of the playing field.
    134133            WeakPtr<PongBat>* bat_; //!< An array with the two bats.
    135             bool bDeleteBats_; //!< Bool, to keep track, of whether bat_ exists or not.
     134            bool bDeleteBats_; //!< Bool, to keep track, of whether this->bat_ exists or not.
    136135            unsigned int* batID_; //!< The object IDs of the bats, to be able to synchronize them over the network.
    137136            float relMercyOffset_; //!< Offset, that makes the player not loose, when, in all fairness, he would have.
  • code/branches/tetris/src/modules/pong/PongBat.cc

    r8105 r8106  
    7373    @brief
    7474        Is called each tick.
    75         //TODO detailed
     75        Moves the bat.
    7676    @param dt
    7777        The time since last tick.
     
    8787                this->movement_ = clamp(this->movement_, -1.0f, 1.0f) * this->speed_;
    8888
    89                 //TODO What does this?
     89                //TODO: Why needed?
    9090                if (this->bMoveLocal_)
    9191                    this->setVelocity(this->getOrientation() * Vector3(this->movement_, 0, 0));
     
    9696                this->bSteadiedPosition_ = false;
    9797            }
     98            // If there is no movement but the position has not been steadied, the velocity is set to zero and the position is reaffirmed.
    9899            else if (!this->bSteadiedPosition_)
    99100            {
  • code/branches/tetris/src/modules/pong/PongBat.h

    r8105 r8106  
    4545    /**
    4646    @brief
    47         The PongBat class manages the bats for @ref orxonox::Pong "Pong", which are the elements controlled by the player.
    48        
     47        The PongBat class manages the bats for @ref orxonox::Pong "Pong", which are the elements controlled by the players.
     48
    4949        It is responsible for the movement (controlled by the players) of the bat.
    50        
     50
    5151    @author
    5252        Fabian 'x3n' Landau
    53        
     53
    5454    @ingroup Pong
    5555    */
     
    110110
    111111            float movement_; //!< The amount (and direction), in z-direction, of movement of the bat.
    112             bool bMoveLocal_; //TODO ???
    113             float speed_; //!< The movementspeed of the bat.
     112            bool bMoveLocal_; //!< Helper to know whether the movement is caused by moveFrontBack() or moveRightLeft().
     113            float speed_; //!< The movement speed of the bat.
    114114            float length_; //!< The length of the bat (in z-direction) as percentage of the height of the playing field.
    115115            float fieldHeight_; //!< The height of the playing field.
    116             bool bSteadiedPosition_; //TODO: ???
     116            bool bSteadiedPosition_; //!< Helper boolean, to keep track of when to steady the position, to ensure network synchronicity.
    117117    };
    118118}
  • code/branches/tetris/src/modules/pong/PongCenterpoint.h

    r8105 r8106  
    5656        - The <b>balltemplate</b> is a template that is applied to the @ref orxonox::PongBall "PongBall", it can be used to attach different things to it, e.g. its @ref orxonox::Model "Model". See below for a usage example.
    5757        - The <b>battemplate</b> is a template that is applied to the @ref orxonox::PongBall "PongBat", it can be used to attach different things to it, e.g. its @ref orxonox::Model "Model". See below for a usage example.
    58         - The <b>ballspeed</b> is the speed with wich the @ref orxonox::PongBall "PongBall" moves. The default is <em>100</em>.
     58        - The <b>ballspeed</b> is the speed with which the @ref orxonox::PongBall "PongBall" moves. The default is <em>100</em>.
    5959        - The <b>ballaccfactor</b> is the acceleration factor for the @ref orxonox::PongBall "PongBall". The default is <em>1.0</em>.
    6060        - The <b>batspeed</b> is the speed with which the @ref orxonox::PongBat "PongBats" move. The default is <em>60</em>.
     
    223223
    224224            std::string balltemplate_; //!< The template for the ball.
    225             std::string battemplate_; //!< The template for the batts.
     225            std::string battemplate_; //!< The template for the bats.
    226226
    227227            float ballspeed_; //!< The speed of then ball.
  • code/branches/tetris/src/modules/pong/PongScore.h

    r5781 r8106  
    2727 */
    2828
     29/**
     30    @file PongScore.h
     31    @brief Declaration of the PongScore class.
     32    @ingroup Pong
     33*/
     34
    2935#ifndef _PongScore_H__
    3036#define _PongScore_H__
     
    3743namespace orxonox
    3844{
     45
     46    /**
     47   
     48    */
    3949    class _PongExport PongScore : public OverlayText, public Tickable
    4050    {
Note: See TracChangeset for help on using the changeset viewer.