Changeset 10111 for code/branches/pickupsFS14/src/modules/jump/Jump.h
- Timestamp:
- Nov 5, 2014, 4:06:09 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickupsFS14/src/modules/jump/Jump.h
r10074 r10111 27 27 */ 28 28 29 /**30 @file Jump.h31 @brief Declaration of the Jump class.32 @ingroup Jump33 */34 35 29 #ifndef _Jump_H__ 36 30 #define _Jump_H__ 37 31 38 32 #include "jump/JumpPrereqs.h" 39 40 33 #include "tools/Timer.h" 41 34 #include "graphics/Camera.h" 42 43 35 #include "gametypes/Deathmatch.h" 44 36 #include "JumpCenterpoint.h" 45 46 37 #include <list> 47 38 48 39 namespace orxonox 49 40 { 50 51 /**52 @brief53 Implements a Jump minigame (<a href="http://en.wikipedia.org/wiki/Jump">Wikipedia::Jump</a>).54 It connects the different entities present in a game of Jump.55 56 - The @ref orxonox::JumpCenterpoint "JumpCenterpoint" is the playing field for the Jump 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::JumpFigure "JumpFigures". 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 />57 The Jump class redistributes the important parameters defined in @ref orxonox::JumpCenterpoint "JumpCenterpoint" to the other entities, that need to know them, e.g. the @ref orxonox::JumpPlatform "JumpPlatform" and the @ref orxonox::JumpFigure "JumpFigures".<br />58 The @ref orxonox::JumpCenterpoint "JumpCenterpoint" needs to exist in a level with the @ref orxonox::Gametype "Gametype" <em>Jump</em>.59 - The @ref orxonox::JumpPlatform "JumpPlatform" is the ball both players play with. The @ref orxonox::JumpPlatform "JumpPlatform" 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::JumpFigure "JumpFigures") of the ball and the effects of the failure of a player to catch the ball (i.e. the scoring of the other player).60 - The two @ref orxonox::JumpFigure "JumpFigures" are the entities through which the players can actively participate in the game, by controlling them. The @ref orxonox::JumpFigure "JumpFigure" class manages the movement (and restrictions thereof) and the influence of the players on the bats.61 62 @author63 Fabian 'x3n' Landau64 65 @ingroup Jump66 */67 41 class _JumpExport Jump : public Deathmatch 68 42 { 69 43 public: 70 Jump(Context* context); //!< Constructor. Registers and initializes the object. 71 virtual ~Jump(); //!< Destructor. Cleans up, if initialized. 72 44 Jump(Context* context); 45 virtual ~Jump(); 73 46 virtual void tick(float dt); 74 75 virtual void start(); //!< Starts the Jump minigame. 76 virtual void end(); ///!< Ends the Jump minigame. 77 78 virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player. 79 80 virtual void playerScored(PlayerInfo* player, int score = 1); //!< Is called when the player scored. 81 47 virtual void start(); 48 virtual void end(); 49 virtual void spawnPlayer(PlayerInfo* player); 82 50 int getScore(PlayerInfo* player) const; 83 51 bool getDead(PlayerInfo* player) const; 84 85 /**86 @brief Set the JumpCenterpoint (the playing field).87 @param center A pointer to the JumpCenterpoint to be set.88 */89 52 void setCenterpoint(JumpCenterpoint* center) 90 53 { center_ = center; } 91 void setConfigValues(); //!< Makes scoreLimit configurable. 92 93 PlayerInfo* getPlayer() const; //!< Get the left player. 54 PlayerInfo* getPlayer() const; 94 55 95 56 protected: 96 void startBall(); //!< Starts the ball with some default speed. 97 void cleanup(); //!< Cleans up the Gametype by destroying the ball and the bats. 98 57 void cleanup(); 99 58 virtual void addPlatform(JumpPlatform* newPlatform, std::string platformTemplate, float xPosition, float zPosition); 100 101 59 virtual JumpPlatformStatic* addPlatformStatic(float xPosition, float zPosition); 102 60 virtual JumpPlatformHMove* addPlatformHMove(float xPosition, float zPosition, float leftBoundary, float rightBoundary, float speed); … … 117 75 virtual void addShield(float xPosition, float zPosition, float leftBoundary, float rightBoundary, float lowerBoundary, float upperBoundary, float xVelocity, float zVelocity); 118 76 virtual void addShield(JumpPlatform* platform); 119 120 77 virtual void addStartSection(); 121 78 virtual void addSection(); 122 79 virtual bool addAdventure(int number); 123 124 80 virtual float randomXPosition(); 125 81 virtual float randomXPosition(int totalColumns, int culomn); … … 129 85 virtual float randomZPositionLower(int totalRows, int row, float sectionBegin, float SectionEnd); 130 86 virtual float randomZPositionUpper(int totalRows, int row, float sectionBegin, float SectionEnd); 131 132 87 virtual float randomPosition(float lowerBoundary, float upperBoundary); 133 88 virtual float randomSpeed(); 134 89 135 WeakPtr<JumpCenterpoint> center_; //!< The playing field.136 WeakPtr<JumpFigure> figure_; //!< The two bats.90 WeakPtr<JumpCenterpoint> center_; 91 WeakPtr<JumpFigure> figure_; 137 92 WeakPtr<Camera> camera; 138 int scoreLimit_; //!< If a player scored that much points, the game is ended. 139 140 float totalScreenShift; 141 float screenShiftSinceLastUpdate; 93 float totalScreenShift_; 94 float screenShiftSinceLastUpdate_; 142 95 int sectionNumber_; 143 96 int adventureNumber_;
Note: See TracChangeset
for help on using the changeset viewer.