Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/hud/src/modules/pong/Pong.h @ 8957

Last change on this file since 8957 was 8351, checked in by rgrieder, 14 years ago

Merged kicklib2 branch back to trunk (includes former branches ois_update, mac_osx and kicklib).

Notes for updating

Linux:
You don't need an extra package for CEGUILua and Tolua, it's already shipped with CEGUI.
However you do need to make sure that the OgreRenderer is installed too with CEGUI 0.7 (may be a separate package).
Also, Orxonox now recognises if you install the CgProgramManager (a separate package available on newer Ubuntu on Debian systems).

Windows:
Download the new dependency packages versioned 6.0 and use these. If you have problems with that or if you don't like the in game console problem mentioned below, you can download the new 4.3 version of the packages (only available for Visual Studio 2005/2008).

Key new features:

  • *Support for Mac OS X*
  • Visual Studio 2010 support
  • Bullet library update to 2.77
  • OIS library update to 1.3
  • Support for CEGUI 0.7 —> Support for Arch Linux and even SuSE
  • Improved install target
  • Compiles now with GCC 4.6
  • Ogre Cg Shader plugin activated for Linux if available
  • And of course lots of bug fixes

There are also some regressions:

  • No support for CEGUI 0.5, Ogre 1.4 and boost 1.35 - 1.39 any more
  • In game console is not working in main menu for CEGUI 0.7
  • Tolua (just the C lib, not the application) and CEGUILua libraries are no longer in our repository. —> You will need to get these as well when compiling Orxonox
  • And of course lots of new bugs we don't yet know about
  • Property svn:eol-style set to native
File size: 4.4 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Fabian 'x3n' Landau
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file Pong.h
31    @brief Declaration of the Pong class.
32    @ingroup Pong
33*/
34
35#ifndef _Pong_H__
36#define _Pong_H__
37
38#include "pong/PongPrereqs.h"
39
40#include "tools/Timer.h"
41
42#include "gametypes/Deathmatch.h"
43#include "PongCenterpoint.h"
44
45namespace orxonox
46{
47
48    /**
49    @brief
50        Implements a Pong minigame (<a href="http://en.wikipedia.org/wiki/Pong">Wikipedia::Pong</a>).
51        It connects the different entities present in a game of Pong.
52
53        - 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 />
54        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 />
55        The @ref orxonox::PongCenterpoint "PongCenterpoint" needs to exist in a level with the @ref orxonox::Gametype "Gametype" <em>Pong</em>.
56        - 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).
57        - 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.
58
59    @author
60        Fabian 'x3n' Landau
61
62    @ingroup Pong
63    */
64    class _PongExport Pong : public Deathmatch
65    {
66        public:
67            Pong(BaseObject* creator); //!< Constructor. Registers and initializes the object.
68            virtual ~Pong(); //!< Destructor. Cleans up, if initialized.
69
70            virtual void start(); //!< Starts the Pong minigame.
71            virtual void end(); ///!< Ends the Pong minigame.
72
73            virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player.
74
75            virtual void playerScored(PlayerInfo* player); //!< Is called when the player scored.
76
77            /**
78            @brief Set the PongCenterpoint (the playing field).
79            @param center A pointer to the PongCenterpoint to be set.
80            */
81            void setCenterpoint(PongCenterpoint* center)
82                { this->center_ = center; }
83
84            PlayerInfo* getLeftPlayer() const; //!< Get the left player.
85            PlayerInfo* getRightPlayer() const; //!< Get the right player.
86
87        protected:
88            virtual void spawnPlayersIfRequested(); //!< Spawns players, and fills the rest up with bots.
89
90            void startBall(); //!< Starts the ball with some default speed.
91            void cleanup(); //!< Cleans up the Gametype by destroying the ball and the bats.
92
93            WeakPtr<PongCenterpoint> center_; //!< The playing field.
94            WeakPtr<PongBall> ball_; //!< The Pong ball.
95            WeakPtr<PongBat> bat_[2]; //!< The two bats.
96            Timer starttimer_; //!< A timer to delay the start of the game.
97    };
98}
99
100#endif /* _Pong_H__ */
Note: See TracBrowser for help on using the repository browser.