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: N5110 PinDetect PowerControl mbed
Diff: Entity.h
- Revision:
- 16:caf613d5b85e
- Parent:
- 15:d5eb13c4c1c6
- Child:
- 17:d6a3b29cab31
diff -r d5eb13c4c1c6 -r caf613d5b85e Entity.h
--- a/Entity.h Sun May 10 09:37:51 2015 +0000
+++ b/Entity.h Sun May 10 13:14:33 2015 +0000
@@ -1,5 +1,6 @@
#ifndef ENTITY_H
#define ENTITY_H
+/// @file Entity.h
/** An entity represents a movable character, such as the player, enemies etc.
* Note that the entity class does not contain the sprite (image) of the entity.
@@ -25,11 +26,16 @@
};
+/// Enemy class
class Enemy : public Entity
{
public:
- Enemy(int x, int y, int w, int h) : Entity(x,y,w,h) {dead = false;}
+ enum Type{SIMPLE, JUMPER, RUNNER};
+
+ public:
+ Enemy(int x, int y, int w, int h, Type type = SIMPLE) : Entity(x,y,w,h), type(type) {dead = false;}
bool dead;
+ Type type;
};
#endif
\ No newline at end of file