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
Diff: Enemy/Enemy.h
- Revision:
- 6:f06ce4cf068a
- Parent:
- 5:8bd09c675f28
--- a/Enemy/Enemy.h Wed May 08 19:41:10 2019 +0000
+++ b/Enemy/Enemy.h Wed May 08 23:21:32 2019 +0000
@@ -10,7 +10,7 @@
/** CrossHairs Class
@author Adam Jones, University of Leeds
@brief Controls the Enemy Sprites in the Wall Defence game
-@date April 2017
+@date April 2019
@brief Revision 1.0
@code
@@ -30,6 +30,31 @@
Action myAc = moving; //Action enumerator
_enemy.set_current_action(myAc); //set enemies current action
+ //get action
+ myAc = _enemy.get_current_action();
+
+ //get position
+ enemy.get_pos()
+
+ //set position
+ Vector2D p = {2, 2} //{x,y}
+ enemy.set_pos(p);
+
+ //get time at which enemy will begin moving
+ float time = get_timeToAttack();
+
+ //set enemies alive flag true/false
+ enemy.set_alive(true);
+
+ //get enemies alive flag true/false
+ enemy.get_alive();
+
+
+ //update enemy
+ int fps = 30;
+ enemy.update(int fps);
+
+
//draw enemy
N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
lcd.init();
@@ -38,6 +63,8 @@
+
+
}
@endcode
@@ -92,11 +119,6 @@
void set_pos(Vector2D p);
/**
- * @brief sets a flag on the enemy showing it is attacking
- * @param attack @details a boolean value showing if the enemy is attacking
- */
- //void set_attack(bool attack);
- /**
* @brief Gets the enemies delay time to it starting to attack
* @return time to attack @details returns a float value for the time in to the level the enemy begins to attack
*/