Untitled

mail@pastecode.io avatar
unknown
plain_text
24 days ago
668 B
2
Indexable
Never
#pragma once

#include <SFML/Graphics.hpp>
#include "Tetromino.h"
#include "Field.h"
#include "Score.h"

class Game {
public:
    Game();
    void run();

private:
    void processEvents();
    void update(float time);
    void render();
    void resetGame();

    sf::RenderWindow window;
    sf::Texture t1, t2, t3;
    sf::Sprite s, background, frame;
    sf::Font font;
    sf::Text scoreText, highScoreText, gameOverText, playAgainText, nextText;
    sf::RectangleShape nextFrame;
    sf::RectangleShape gridLines[10 * 23];

    Tetromino current, next;
    Field field;
    Score score;

    float timer, delay;
    bool gameOver;
    int dx;
    bool rotate;
};
Leave a Comment