player.hpp 738 B

1234567891011121314151617181920212223242526272829
  1. #ifndef _player_
  2. #define _player_
  3. #include "game_object.hpp"
  4. #include "rocket.hpp"
  5. #include "definitions.hpp"
  6. #include <list>
  7. class player : public game_object
  8. {
  9. public:
  10. player(); //default constructor: creates a 8-long player in C/2,R
  11. player(int); //user-defined length constructor
  12. ~player() {}
  13. void next_pos(int command); //moves player according to command (WASD or arrow keys)
  14. void shoot(std::list<bullet> &); //adds a new bullet to the list
  15. void shootrkt(std::list<rocket> &);
  16. void set_commands(int* _commands);
  17. int weaponclass;
  18. int weaponclassrkt;
  19. int length;
  20. bool rocketlauncher; //when rocketlauncher is TRUE, player can shoot rockets.
  21. int commands[4];
  22. bool godmode;
  23. };
  24. #endif