Albert Tan-Mulligan
/
ELEC2645_Project_el18ajst
Diff: Enemy/Enemy.cpp
- Revision:
- 10:71ced616a64f
- Parent:
- 9:62fe47a1374f
- Child:
- 14:2d7e41f46879
--- a/Enemy/Enemy.cpp Sat May 23 13:26:19 2020 +0000 +++ b/Enemy/Enemy.cpp Sun May 24 21:20:40 2020 +0000 @@ -1,10 +1,8 @@ #include "Enemy.h" #include <Bitmap.h> Serial pce(USBTX, USBRX); -// nothing doing in the constructor and destructor Enemy::Enemy(int seed) { - _dead = false; srand(seed); four = (rand()%4)+1; //pce.printf("%d",four); @@ -42,7 +40,6 @@ void Enemy::update(int player_x, int player_y) { - if(_dead == false){ if(_x<player_x){ _x++; } @@ -56,7 +53,7 @@ else if (_y > player_y){ _y--; } - } + } int Enemy::get_x() { @@ -68,12 +65,7 @@ return _y; } -void Enemy::dead(){ - _dead = true; - _x = 2147483647; -} void Enemy::reset(int seed){ - _dead = false; srand(seed); four = (rand()%4)+1; //pce.printf("%d",four);