enemy.hpp 733 B

12345678910111213141516171819202122232425262728293031
  1. /* This file is part of Invaders.
  2. *
  3. * Copyright (C) 2020 LCM.
  4. * You may use, distribute and modify Invaders under the terms of the
  5. * GPLv3 license, available at <https://www.gnu.org/licenses/\>.
  6. */
  7. #ifndef _enemy_
  8. #define _enemy_
  9. #include "game_object.hpp"
  10. #include "bullet.hpp"
  11. #include "definitions.hpp"
  12. class enemy : public game_object
  13. {
  14. public:
  15. enemy(); //costruttori:
  16. enemy(int X,int Y); //id viene automaticamente settato a 4, direction a 0, alive a true
  17. ~enemy(){}
  18. void next_pos();
  19. void shoot(std::list<bullet> &); //genera un nuovo proiettile
  20. bool alive; //0: morto, 1: vivo
  21. int direction; //0: si sta muovendo a dx, 1: a sx, 2: verso il basso
  22. };
  23. #endif