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.
Diff: Alien/Alien.h
- Revision:
- 28:a5958497d5ce
- Parent:
- 27:8bb2bd97c319
- Child:
- 31:6015e8ed859c
diff -r 8bb2bd97c319 -r a5958497d5ce Alien/Alien.h
--- a/Alien/Alien.h Wed May 13 14:30:12 2020 +0000
+++ b/Alien/Alien.h Wed May 13 23:07:52 2020 +0000
@@ -7,13 +7,14 @@
#include "Gamepad.h"
#include "Weapons.h"
#include "Position.h"
+#include "RandomMovement.h"
/** Alien class
* @brief Draws and moves aliens
* @author Benjamin Evans, University of Leeds
* @date May 2020
*/
-class Alien: private Position {
+class Alien:private RandomMovement {
public:
/** Constructor */
Alien();
@@ -46,7 +47,8 @@
* @return position_x_alien_
*/
Vector2D get_pos();
-
+
+ int get_alien_fire_counter();
private:
// Function prototypes -----------------------------------------------------
@@ -62,19 +64,6 @@
*/
int calc_alien_movement(Direction d_);
- /** Generates the random move dirction and length for the alien*/
- void set_random_move();
-
- /** Gets the movement direction of the alien */
- void move_direction();
-
- /** Changes the x and y positions of the alien depeding on the movement
- * direction
- * @param x_change @details number to change alien x position by
- * @param y_change @detials number to change alien y position by
- */
- void set_alien_direction(int x_change,int y_change);
-
/** Stops the alien from moving off the edge of the map and moves alien
* if the map loops
* @param map_length_@details : length of the map
@@ -86,13 +75,11 @@
// Variables ---------------------------------------------------------------
/** Alien movement counter */
- int alien_move_counter;
-
- /** Alien randome move counter */
- int random_move_counter_;
-
- /** Random direction variable */
- int random_direction_;
+ int alien_move_counter_;
+
+ /** Alien fire bullet counter */
+ int alien_fire_counter_;
+
};
#endif
\ No newline at end of file