#ifndef ENEMY_H #define ENEMY_H #include #include #include #include #include #include "bullet.h" #include "trajectory.h" class Enemy { public: Enemy( int16_t _x, int16_t _y, uint8_t _id ); ~Enemy(); void Update( float dt ); void Render( void ); bool Test_Impact( Bullet *projectile ); void Set_Speed_Vector( uint8_t _sp, uint8_t _xd, uint8_t _yd); libnum::num x, y; // center position of the ennemy uint8_t width, height; // width and height -for the hitbox int16_t xmin, xmax, ymin, ymax; // square hitbox (to speed up the bullet impact calculations) uint8_t ID; int16_t life; uint8_t speed; // speed of this ennemy bool toberemoved; bool hasTrajectory = false; Trajectory *pathToFollow; private: int8_t dirx, diry; // vector of the current direction of the ennemy (TODO : to implement more complex displacement pattern) uint32_t lastshottime; bool Shoot_OK( uint32_t tempshoot ); }; #endif