master
ブランチ master
BrickBreaker / src / brick.hh
489 B、31行 生 Blame 履歴
1#ifndef BRICK_H
2#define BRICK_H
3
4#include <SDL2/SDL.h>
5#include <iostream>
6
7#include "render.hh"
8#include "player.hh"
9#include "ball.hh"
10
11class Brick {
12 public:
13 int col = 7;
14 int row = 5;
15 int gaps = 16;
16
17 bool bricks[7*5];
18
19 SDL_Color color = {255, 255, 255};
20 SDL_Rect brick;
21
22 void resetBricks(Render &r, Player &p, Ball &bl);
23 void setBricks(int i);
24
25 Brick(Render& r) {
26 brick.w = (r.width - (gaps * col)) / col;
27 brick.h = 22;
28 }
29};
30
31#endif