12345678910111213141516171819202122232425262728293031323334353637 |
- /* This file is part of Invaders.
- *
- * Copyright (C) 2020 LCM.
- * You may use, distribute and modify Invaders under the terms of the
- * GPLv3 license, available at <https://www.gnu.org/licenses/\>.
- */
- #ifndef _player_
- #define _player_
- #include "game_object.hpp"
- #include "rocket.hpp"
- #include "definitions.hpp"
- #include <list>
- class player : public game_object
- {
- public:
- player(); //default constructor: creates a 8-long player in C/2,R
- player(int); //user-defined length constructor
- ~player() {}
-
- void next_pos(int command); //moves player according to command (WASD or arrow keys)
- void shoot(std::list<bullet> &); //adds a new bullet to the list
- void shootrkt(std::list<rocket> &);
- void set_commands(int* _commands);
- int weaponclass;
- int weaponclassrkt;
- int length;
- bool rocketlauncher; //when rocketlauncher is TRUE, player can shoot rockets.
- int commands[4];
- bool godmode;
- };
- #endif
|