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
GameObject/GameObject.h
- Committer:
 - el15as
 - Date:
 - 2017-05-03
 - Revision:
 - 12:0a5758356381
 - Parent:
 - 8:c3cf8d1057bb
 
File content as of revision 12:0a5758356381:
#ifndef GAMEOBJECT_H
#define GAMEOBJECT_H
#include "mbed.h"
#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();
    /** 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);
};
#endif