Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Level/Level.h
- Committer:
- joshdavy
- Date:
- 2019-05-06
- Revision:
- 12:5549a299d41e
- Parent:
- 11:db27d3838514
- Child:
- 13:32d580b3935c
File content as of revision 12:5549a299d41e:
#ifndef LEVEL_H #define LEVEL_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Bitmap.h" #include "LevelDefinitions.h" #include "GoalSprite.h" /** * @brief Struct for storing the current location/state of any moving blocks */ struct MovingBlock { int index; int distance; int initial_pos; bool extending; }; /** Level Class @brief Class responsible for the handling of levels loading them updating their state and rendering them. Levels represent each stage of the game including the player initial location the goal location and the location of blocks and moving blocks. @version 1.0 @author Joshua Davy el17jd @date April 2019 */ class Level { public: Level(); ~Level(); void init(Block blocks [], int number_of_blocks, Vector2D goal, MovingBlockDefinition moving_blocks[], int number_of_moving_blocks); void update_moving_blocks(); void render(N5110 &lcd); void declare_moving_block(int index,bool extending,int distance); Block * get_blocks(); int get_number_of_blocks(); Vector2D get_goal(); private: Block _blocks [20] ; int _number_of_blocks; int _number_of_moving_blocks; Vector2D _goal; MovingBlock _moving_blocks [10]; }; #endif