レポジトリ種類: Mercurial

#ifndef BRICK_H
#define BRICK_H

#include <SDL2/SDL.h>
#include <iostream>

#include "render.hh"
#include "player.hh"
#include "ball.hh"

class Brick {
  public:
    int col = 7;
    int row = 5;
    int gaps = 16;

    bool bricks[7*5];

    SDL_Color color = {255, 255, 255};
    SDL_Rect brick;

    void resetBricks(Render &r, Player &p, Ball &bl);
    void setBricks(int i);

    Brick(Render& r) {
      brick.w = (r.width - (gaps * col)) / col;
      brick.h = 22;
    }
};

#endif