init
This commit is contained in:
commit
f698a38c7e
585 changed files with 118338 additions and 0 deletions
38
SimpleGame/src_original/Include/Game.hpp
Normal file
38
SimpleGame/src_original/Include/Game.hpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
#ifndef BOOK_GAME_HPP
|
||||
#define BOOK_GAME_HPP
|
||||
|
||||
#include <SFML/Graphics.hpp>
|
||||
|
||||
class Game {
|
||||
public:
|
||||
Game();
|
||||
Game(const Game &) = delete;
|
||||
Game &operator=(const Game &) = delete;
|
||||
void run();
|
||||
|
||||
private:
|
||||
void processEvents();
|
||||
void update(sf::Time elapsedTime);
|
||||
void render();
|
||||
|
||||
void updateStatistics(sf::Time elapsedTime);
|
||||
void handlePlayerInput(sf::Keyboard::Key key, bool isPressed);
|
||||
|
||||
static const float PlayerSpeed;
|
||||
static const sf::Time TimePerFrame;
|
||||
|
||||
sf::RenderWindow mWindow{sf::VideoMode({640, 480}), "SFML Application"};
|
||||
sf::Texture mTexture;
|
||||
sf::CircleShape mTarget;
|
||||
sf::Font mFont;
|
||||
sf::Text mStatisticsText{mFont};
|
||||
sf::Time mStatisticsUpdateTime;
|
||||
|
||||
std::size_t mStatisticsNumFrames{0};
|
||||
bool mIsMovingUp{false};
|
||||
bool mIsMovingDown{false};
|
||||
bool mIsMovingRight{false};
|
||||
bool mIsMovingLeft{false};
|
||||
};
|
||||
|
||||
#endif // BOOK_GAME_HPP
|
Loading…
Add table
Add a link
Reference in a new issue