You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
884 B
C++
37 lines
884 B
C++
#include <string>
|
|
|
|
#include <SFML/System.hpp>
|
|
#include <SFML/Window.hpp>
|
|
|
|
#include "player.hpp"
|
|
#include "level.hpp"
|
|
|
|
#pragma once
|
|
|
|
namespace Proto4 {
|
|
enum class GameState { Uninitialized, Running, Paused, Finished };
|
|
|
|
class Game : public sf::Drawable, public sf::Transformable {
|
|
public:
|
|
virtual void draw(sf::RenderTarget &window, sf::RenderStates states) const;
|
|
AppState update(sf::RenderWindow &window, sf::Time timestep);
|
|
AppState handleKey(const sf::Event &event);
|
|
void resize(sf::Event& resizeEvent);
|
|
sf::View& getMainView();
|
|
|
|
bool init();
|
|
void pause();
|
|
void resume();
|
|
|
|
private:
|
|
bool start();
|
|
bool reset();
|
|
|
|
sf::View mainView{};
|
|
GameState state = GameState::Uninitialized;
|
|
Player player{};
|
|
Level level{};
|
|
uint32_t score = 0;
|
|
};
|
|
}
|