40 #ifndef ARKANOID_REMAKE_H
41 #define ARKANOID_REMAKE_H
189 virtual void Start();
206 virtual void Frame()=0;
222 virtual bool DropBonus(
const std::string& name,
const VecXy& pos);
235 #endif//ARKANOID_REMAKE_H
virtual void GoToNextLevel()
Go to the next level.
unsigned int mTotalScore
Total game score.
Definition: ArkanoidRemake.h:129
virtual bool SetCurrentLevel(unsigned int n)
Set the current level.
virtual bool Init()
App interface implementation.
virtual double GetTime()=0
Get the current time in seconds.
Bonus item, dropped when a wall block is hit.
Definition: Bonus.h:52
virtual void HitShip()
The ship hit the ball.
Game ball definition.
Definition: Ball.h:51
Vector with two (double precision) coordinate values.
Definition: VecXy.h:59
App interface definition.
virtual void HandleEvents()=0
Handle input events.
virtual void AddScore(int n)
Add the givent points to the score.
Ship mShip
Ship object.
Definition: ArkanoidRemake.h:99
virtual void AddLevel()
Add a (the only one foer now) new level.
virtual void Frame()=0
Render a frame.
unsigned int mBlocksLeft
Counter for the blocks not yet destroyed.
Definition: ArkanoidRemake.h:132
void CalculateBonusPosition()
Calculate the bonuses position according to their velocity and the play area size.
std::vector< Level > mLevel
List of game levels.
Definition: ArkanoidRemake.h:114
void LaunchBall()
Launch tha ball (if held by the ship)
virtual void HitBlock(Block &block, int x, int y)
Actions implementation.
virtual void Start()
Initialize the score and go to the first level.
virtual void BonusLost(const Bonus &bonus)
The ship missed a bonus.
virtual bool DropBonus(const std::string &name, const VecXy &pos)
A bonus item was dropped.
Base class for an implementation of a remake of the old game Arkanoid.
Definition: ArkanoidRemake.h:88
Ball mBall
Ball object.
Definition: ArkanoidRemake.h:96
std::vector< Bonus > mBonus
List of dropped bunuses.
Definition: ArkanoidRemake.h:117
Wall block.
Definition: Block.h:52
virtual void GetBonus(const Bonus &bonus)
The ship hit a bonus item.
PlayArea mPlayArea
Play area definition.
Definition: ArkanoidRemake.h:93
ArkanoidRemake()
Constructor: just initialize data members.
unsigned int mCurrLevel
Index of the active level.
Definition: ArkanoidRemake.h:102
Matrix with the wall blocks of the game.
Definition: BlockMatrix.h:52
bool CheckBallCollision(int x, int y)
Check (and manage) the collision between the ball and the walls.
BlockMatrix class definition.
Application interface definition.
Definition: App.h:56
void MoveBallWithShip()
Move the ball along with the ship (when it is attached)
BlockMatrix mBlock
Current blocks configuration.
Definition: ArkanoidRemake.h:111
bool CheckBallBlockCollision(const Block &block, int x, int y)
Check (and manage) the collision between the ball and a block.
virtual void UpdateScoreText()
Update the score text.
std::map< std::string, Bonus > mBonusDef
Bonus definitions (templates for bonus creation)
Definition: ArkanoidRemake.h:120
unsigned int mLevelScore
Score reached within the current level.
Definition: ArkanoidRemake.h:126
Play area definition.
Definition: PlayArea.h:46
bool CalculateShipPosition(int x=-1)
Calculate the ship position according to the play area size.
virtual void BallLost()
The ship missed the ball.
bool CalculateBallPosition()
Calculate the ball position according to its velocity and the play area size.
Game ship object definition.
Definition: Ship.h:53
virtual void Update()
Update the application (call it in an iteration loop)
std::string mScoreText
Score text buffer.
Definition: ArkanoidRemake.h:123