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
Enemy/Enemy.h
- Committer:
- adat80
- Date:
- 2019-04-28
- Revision:
- 3:97cd7b3d89d0
- Parent:
- 2:88019d96e1da
- Child:
- 5:8bd09c675f28
File content as of revision 3:97cd7b3d89d0:
#ifndef ENEMY_H
#define ENEMY_H
#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include <time.h>
/** CrossHairs Class
@author Adam Jones, University of Leeds
@brief Controls the Enemy Sprites in the Wall Defence game
@date April 2017
*/
enum Action { waiting, moving, attacking, dying };
class Enemy
{
public:
Enemy();
~Enemy();
Action enemAction;
void init(float timeToAttack, float speed);
void draw(N5110 &lcd);
void update(int fps);
/// accessors and mutators
Vector2D get_pos();
void set_pos(Vector2D p);
void set_attack(bool attack);
float get_timeToAttack();
void set_current_action(Action act);
Action get_current_action();
void set_alive(bool alive);
bool get_alive();
void set_value(float value);
float get_value();
private:
float _x;
float _y;
bool _attack;
bool _alive;
float _timeToAttack;
float _speed;
float _animationTick;
Action currentAction;
float _value;
};
#endif