Changeset 10040 for code/branches/pickupsFS14/src/modules/jump/Jump.h
- Timestamp:
- Apr 17, 2014, 4:29:25 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickupsFS14/src/modules/jump/Jump.h
r10032 r10040 21 21 * 22 22 * Author: 23 * F lorian Zinggeler23 * Fabian 'x3n' Landau 24 24 * Co-authors: 25 25 * ... … … 29 29 /** 30 30 @file Jump.h 31 @brief Gametype.31 @brief Declaration of the Jump class. 32 32 @ingroup Jump 33 33 */ … … 37 37 38 38 #include "jump/JumpPrereqs.h" 39 40 #include "tools/Timer.h" 41 #include "graphics/Camera.h" 42 39 43 #include "gametypes/Deathmatch.h" 40 #include "JumpCenterPoint.h" 41 #include "tools/Timer.h" 42 #include "JumpPlatform.h" 43 #include <list> 44 44 #include "JumpCenterpoint.h" 45 45 46 46 namespace orxonox 47 47 { 48 48 49 /** 50 @brief 51 Implements a Jump minigame (<a href="http://en.wikipedia.org/wiki/Jump">Wikipedia::Jump</a>). 52 It connects the different entities present in a game of Jump. 53 54 - 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 /> 55 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 /> 56 The @ref orxonox::JumpCenterpoint "JumpCenterpoint" needs to exist in a level with the @ref orxonox::Gametype "Gametype" <em>Jump</em>. 57 - 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). 58 - 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. 59 60 @author 61 Fabian 'x3n' Landau 62 63 @ingroup Jump 64 */ 49 65 class _JumpExport Jump : public Deathmatch 50 66 { 51 67 public: 52 Jump(Context* context); 53 virtual void start(); 54 //virtual void end(); 55 //virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command 68 Jump(Context* context); //!< Constructor. Registers and initializes the object. 69 virtual ~Jump(); //!< Destructor. Cleans up, if initialized. 56 70 57 71 virtual void tick(float dt); 58 72 59 //void spawnEnemy(); 73 virtual void start(); //!< Starts the Jump minigame. 74 virtual void end(); ///!< Ends the Jump minigame. 60 75 61 v oid setCenterpoint(JumpCenterPoint* center){ this->center_ = center; }76 virtual void spawnPlayer(PlayerInfo* player); //!< Spawns the input player. 62 77 63 virtual void addPlatform(float x, float y);78 virtual void playerScored(PlayerInfo* player, int score = 1); //!< Is called when the player scored. 64 79 65 /*int getLives(){return this->lives;} 66 int getLevel(){return this->level;} 67 int getPoints(){return this->point;} 68 int getMultiplier(){return this->multiplier;}*/ 80 /** 81 @brief Set the JumpCenterpoint (the playing field). 82 @param center A pointer to the JumpCenterpoint to be set. 83 */ 84 void setCenterpoint(JumpCenterpoint* center) 85 { this->center_ = center; } 86 void setConfigValues(); //!< Makes scoreLimit configurable. 69 87 70 /*void costLife(); 71 void levelUp(); 72 void addPoints(int numPoints); 73 // checks if multiplier should be reset. 74 void comboControll();*/ 75 //int lives; 76 //int multiplier; 77 //bool bEndGame; 78 //bool bShowLevel; 79 private: 80 //void toggleShowLevel(){bShowLevel = !bShowLevel;} 81 WeakPtr<JumpShip> getPlayer(); 82 WeakPtr<JumpCenterPoint> center_; 83 WeakPtr<JumpShip> player; 88 PlayerInfo* getPlayer() const; //!< Get the left player. 89 90 protected: 91 virtual void spawnPlayersIfRequested(); //!< Spawns players, and fills the rest up with bots. 92 93 void startBall(); //!< Starts the ball with some default speed. 94 void cleanup(); //!< Cleans up the Gametype by destroying the ball and the bats. 95 96 WeakPtr<JumpCenterpoint> center_; //!< The playing field. 97 WeakPtr<JumpPlatform> ball_; //!< The Jump ball. 98 WeakPtr<JumpFigure> figure_; //!< The two bats. 84 99 WeakPtr<Camera> camera; 100 Timer starttimer_; //!< A timer to delay the start of the game. 101 int scoreLimit_; //!< If a player scored that much points, the game is ended. 85 102 86 /*Timer enemySpawnTimer; 87 Timer comboTimer; 88 Timer showLevelTimer; 89 //Context* context; <-- War schon auskommentiert!!! 90 int level; 91 int point; 92 bool b_combo;*/ 93 std::list<JumpPlatform*> platformList; 94 float yScreenPosition; 95 float screenShiftSinceLastUpdate; 103 float totalScreenShift; 96 104 }; 97 105 }
Note: See TracChangeset
for help on using the changeset viewer.