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.
Dependencies: mbed
Diff: GameObject/GameObject.h
- Revision:
- 12:0a5758356381
- Parent:
- 8:c3cf8d1057bb
--- a/GameObject/GameObject.h Wed May 03 19:12:39 2017 +0000
+++ b/GameObject/GameObject.h Wed May 03 19:57:08 2017 +0000
@@ -5,27 +5,63 @@
#include "N5110.h"
#include "Gamepad.h"
+/** Constants */
#define OBJECTCOUNT 51
#define MENUOBJECTCOUNT 10
+/** GameObject class
+@brief Stores the parameters of on-screen objects
+
+@brief Revision 1.0
+
+@author Aleksejs Sladzevskis
+@date 3rd May 2017
+*/
+
class GameObject
{
public:
+ /** Constructor */
GameObject();
+
+ /** Destructor */
~GameObject();
- int type; // 0 - Platform, 1 - Horizontal Spikes, 2 - Vertical Spikes, 3 - Door, 4 - Switch, 5 - Uncollected Coin, 6 - Collected Coin, 7 - Menu Box
- intVector2D position; // Top-left corner of the cube
+ /** Type of the object where:
+ * 0 - Platform,
+ * 1 - Horizontal Spikes,
+ * 2 - Vertical Spikes,
+ * 3 - Door,
+ * 4 - Switch,
+ * 5 - Uncollected Coin,
+ * 6 - Collected Coin,
+ * 7 - Menu Box
+ */
+ int type;
+
+ /** Coordinates of object's top-left corner */
+ intVector2D position;
+
+ /** Object's width */
int width;
+
+ /** Object's height */
int height;
+ /** Check whether the object contains given point
+ *@param x x-coordinate to check
+ *@param y y-coordinate to check
+ */
bool containsPoint(int x, int y);
private:
+ // Check x coordinate
bool containsX(int _x);
+
+ // Check y coordinate
bool containsY(int _y);
};