Starlight.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * one room arena
  3. * Copyright (C) 2016 POSITIVE MENTAL ATTITUDE
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, version 3 of the License.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #pragma once
  18. #include <SFML/Graphics.hpp>
  19. #include <SFML/Audio.hpp>
  20. #include "Player.hpp"
  21. #include "Map.hpp"
  22. #include "Menu.hpp"
  23. #include "Powerup.hpp"
  24. using namespace sf;
  25. class Starlight
  26. {
  27. public:
  28. Starlight() = delete;
  29. Starlight(RenderWindow* window, bool* keepRunning);
  30. ~Starlight();
  31. void run();
  32. private:
  33. void events();
  34. void input(float delta);
  35. void logic(float delta);
  36. void render();
  37. void toggleFrame(bool on, float delta);
  38. RenderWindow* _window;
  39. Map _map;
  40. ActualPlayer _player;
  41. std::vector<AiPlayer*> _enemy;
  42. Menu _menu;
  43. PowerupManager _powerups;
  44. RectangleShape _frame;
  45. View _view;
  46. int _returnCode;
  47. bool _running;
  48. bool* _keepRunning;
  49. };