37 #ifndef ARKANOID_REMAKE_SDL_H
38 #define ARKANOID_REMAKE_SDL_H
57 std::string mShipSurf;
58 std::string mBallSurf;
59 std::string mPlayAreaSurf;
60 std::string mBkgndSurf;
61 std::string mSnowfallSurf;
125 void DrawBackground();
211 #endif//ARKANOID_REMAKE_SDL_H
bool SetCurrentLevel(unsigned int n)
Set up the graphics for the current level.
ArkanoidRemake class definition.
double GetTime()
Get the current time in seconds (definition of the base class abstract method)
virtual void Frame()
Render a frame.
Bonus item, dropped when a wall block is hit.
Definition: Bonus.h:52
Vector with two (double precision) coordinate values.
Definition: VecXy.h:59
bool LoadConfiguration(const std::string &file_path)
Load the game configuration.
void BallLost()
The ship missed the ball.
static Configuration smDefaultConfig
Default configuration used in case the configuration fila is not readable.
Definition: ArkanoidRemakeSdl.h:181
std::string mBlockMatrixName
Identifier of the container for blocks images.
Definition: ArkanoidRemakeSdl.h:73
SDL application manager.
Definition: sdltk.h:188
sdltk::SdlApp mSdlApp
SDL application manager, implementing event management, sound and graphics.
Definition: ArkanoidRemakeSdl.h:76
Configuration mConfig
Configuration loaded from the file (see smDefaultConfig)
Definition: ArkanoidRemakeSdl.h:184
void HitBlock(Block &block, int x, int y)
Actions implementation.
void AddScore(int n)
Add the givent points to the score.
void Update()
Update the application (call it in an iteration loop)
double mBkgndScroll
Value controlling the background scroll.
Definition: ArkanoidRemakeSdl.h:65
Game configuration data structure. It is loaded on startup and saved to disk on exit.
Definition: ArkanoidRemakeSdl.h:170
Implementation of ArkanoidRemake using SDL library.
Definition: ArkanoidRemakeSdl.h:51
ArkanoidRemakeSdl()
Constructor: initialize members values.
Functor class for application events.
Definition: ArkanoidRemakeSdl.h:152
void Start()
Initialize the score and go to the first level.
void BonusLost(const Bonus &bonus)
The ship missed a bonus.
Base class for an implementation of a remake of the old game Arkanoid.
Definition: ArkanoidRemake.h:88
Functor class for events handling.
Definition: sdltk.h:136
ArkanoidRemakeSdl * mApp
Internal reference to the application.
Definition: ArkanoidRemakeSdl.h:156
Wall block.
Definition: Block.h:52
void HitShip()
The ship hit the ball.
bool DropBonus(const std::string &name, const VecXy &pos)
A bonus item was dropped.
void GoToNextLevel()
Set up the graphics for the next level.
void AddLevel()
Add a (the only one foer now) new level.
AppEventFunctor(ArkanoidRemakeSdl *app)
Constructor: it requires a reference to the owner application.
bool SetBackground(const std::string &file_name)
Use the given image file to fill the background.
void PlaySound(const std::string &name)
Play the named sound.
void GetBonus(const Bonus &bonus)
The ship hit a bonus item.
void CleanUp()
Clean up the application and free memory.
virtual void HandleEvents()
Handle input events.
virtual bool operator()(const sdltk::EventData &evt_data)
Functor operator.
Utility timer (e.g. for dynamics calculations)
Definition: sdltk.h:144
unsigned mBkgndColor
Color used for background if an image is not available.
Definition: ArkanoidRemakeSdl.h:79
bool Init()
App interface implementation.
Event data structure.
Definition: sdltk.h:112
bool SaveConfiguration(const std::string &file_path)
Save the game configuration.
bool LoadFiles()
Load images, sounds, etc. with SDL toolkit.
bool InitSdl()
Initialize SDL with SDL toolkit.
void UpdateScoreText()
Update the GUI text.
void Stop()
Stop the application.