43 lines
975 B
C++
43 lines
975 B
C++
#pragma once
|
|
|
|
#include <SFML/Graphics/RectangleShape.hpp>
|
|
#include <SFML/Graphics/Sprite.hpp>
|
|
#ifndef BOOK_GAME_HPP
|
|
#define BOOK_GAME_HPP
|
|
|
|
#include "AudioEmitter.hpp"
|
|
#include <GameData.hpp>
|
|
#include <SFML/Graphics.hpp>
|
|
|
|
class Game {
|
|
public:
|
|
Game();
|
|
Game(const Game &) = delete;
|
|
Game &operator=(const Game &) = delete;
|
|
void run();
|
|
|
|
private:
|
|
void processEvents(AudioEmitter &audioEmitter);
|
|
void start();
|
|
void update(sf::Time elapsedTime);
|
|
void render();
|
|
|
|
void updateStatistics(AudioEmitter &audioEmitter);
|
|
|
|
static const sf::Time TimePerFrame;
|
|
|
|
sf::RenderWindow mWindow{sf::VideoMode({SCREEN_WIDTH, SCREEN_HEIGHT}),
|
|
"SFML Application"};
|
|
sf::Texture mTexture;
|
|
sf::Font mFont;
|
|
sf::Text mStatisticsText{mFont};
|
|
sf::Time mStatisticsUpdateTime;
|
|
|
|
sf::RectangleShape leftPressZone;
|
|
sf::RectangleShape middlePressZone;
|
|
sf::RectangleShape rightPressZone;
|
|
|
|
std::size_t mStatisticsNumFrames{0};
|
|
};
|
|
|
|
#endif // BOOK_GAME_HPP
|