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 Gamepad N5110 mbed-rtos
Diff: EnemyBeam/EnemyBeam.h
- Revision:
- 0:d9cf94b41df3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/EnemyBeam/EnemyBeam.h Thu May 09 09:49:35 2019 +0000 @@ -0,0 +1,70 @@ +#ifndef ENEMYBEAM_H +#define ENEMYBEAM_H + +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" +#include "Enemy.h" + +// gap from edge of screen +#define GAP 2 + +/** EnemyBeam Class + * @brief Enemy beam in stage one + * @author Rex Roshan Raj + */ +class EnemyBeam +{ + +public: + + /** Constructor */ + EnemyBeam(); + + /** Destructor */ + ~EnemyBeam(); + + /** Initialise the parameters for the enemy's beam + *@param size - size of the beam + *@param a - x position of the enemy's beam + *@param b - y position of the enemy's beam + */ + void init(int size,int a, int b); + + /** Updates the beam + * @brief Changes the x position of the beam once it has been initialised + */ + void update(); + + /** Draws the enemy's beam + * @param N5110 lcd + */ + void draw(N5110 &lcd); + + /** Gets the position of the enemy's beam + * @returns a struct with x,y members which corresponds to x and y position respectively + */ + Vector2D get_pos(); + + /** Sets the position of the enemy's beam + * @brief Position of the enemy's beam + * @param position + */ + void set_pos(Vector2D p); + +private: + + + Enemy _e1; + + int _speed; + int _size; + + int _x; + int _y; + int _a; + int _b; + +}; + +#endif \ No newline at end of file