Untitled

mail@pastecode.io avatar
unknown
plain_text
18 days ago
476 B
2
Indexable
Never
#ifndef TETROMINO_H
#define TETROMINO_H

#include <SFML/Graphics.hpp>
#include <array>

struct Point {
    int x, y;
};

class Tetromino {
public:
    Tetromino();
    void generateNewTetromino();
    bool checkCollision(int field[23][10]);
    void move(int dx, int field[23][10]);
    void rotate(int field[23][10]);
    const std::array<Point, 4>& getBlockPositions() const;
    int getColorNum() const;

private:
    std::array<Point, 4> a, b;
    int colorNum;
};

#endif
Leave a Comment