Untitled

mail@pastecode.io avatar
unknown
plain_text
15 days ago
663 B
2
Indexable
Never
#pragma once
#include <SFML/Graphics.hpp>

struct Point {
    int x, y;
};

class Tetromino {
public:
    Tetromino();
    void reset(int color, int type, const int figures[7][4]);
    void rotate();
    void move(int dx, int dy);
    bool checkCollision(int field[23][10]) const;
    void draw(sf::Sprite &sprite, sf::RenderWindow &window) const;
    Point a[4], b[4], c[4];
    int colorNum;
    int nextColorNum;
    int nextTemo;
    float timer;
    float delay;
    bool gameOver;

private:
    void setFigure(int type, int offset);
    bool check() const;
    bool isDraw() const;
    bool checkI() const;
    bool checkO() const;
    int figures[7][4];
};
Leave a Comment