Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if !defined PLAY_STATE_HPP
- #define PLAY_STATE_HPP
- #include <prg_interactive.hpp>
- #include "snake.hpp"
- #include "square.hpp"
- #include "circle.hpp"
- #include "triangle.hpp"
- #include <list>
- //Example of forward declaration of Snake class
- class Snake;
- class PlayState final : public prg::IAppState,
- public prg::IKeyEvent,
- public prg::ITimerEvent {
- public:
- PlayState() = default;
- bool onCreate() override;
- bool onDestroy() override;
- void onEntry() override;
- void onExit() override;
- void onUpdate() override;
- void onRender(prg::Canvas& canvas) override;
- bool onKey(const prg::IKeyEvent::KeyEvent& key_event) override;
- void onTimer(prg::Timer& timer) override;
- private:
- //Snake* snakes_[2] {nullptr,nullptr};
- std::list<Snake*> snakes_;
- prg::Timer game_timer_ {0, 1000 / 30, *this};
- const prg::Image background_ {prg::ImageFile("resources/images/background.bmp").load()};
- std::vector<Shape> shapes_;
- };
- #endif // PLAY_STATE_HPP
Advertisement
Add Comment
Please, Sign In to add comment