bullet.hpp 621 B

123456789101112131415161718192021222324252627
  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 _bullet_
  8. #define _bullet_
  9. #include "game_object.hpp"
  10. class bullet : public game_object
  11. {
  12. public:
  13. bullet(int X,int Y,int ID) : game_object(X,Y,ID) {} //constructor
  14. ~bullet() {}
  15. void next_pos(); //evaluates next position checking bullet's id (laser or bomb)
  16. bool operator==(bullet& other) { if(other.x==x && other.y==y && other.id==id) return true; else return false; }
  17. };
  18. #endif