1
0
Fork 0
breakout/src/brick.hpp

37 lines
544 B
C++
Raw Normal View History

2015-10-04 12:48:57 +00:00
#include "SDL2/SDL.h"
#include "breakout.hpp"
typedef enum Color {
RED,
ORANGE,
YELLOW,
GREEN,
LIGHTBLUE,
BLUE,
PURPLE
} Color;
typedef enum BounceDirection {
None,
Top,
Bottom,
Left,
Right
} BounceDirection;
2015-10-04 12:48:57 +00:00
class Brick {
public:
Brick(SDL_Renderer *r, int x, int y, Color c);
~Brick();
BounceDirection collide(int x1, int y1, int x2, int y2);
2015-10-04 13:53:19 +00:00
void destroy();
2015-10-04 12:48:57 +00:00
void render();
private:
SDL_Renderer *renderer;
SDL_Rect brick;
Color color;
2015-10-04 13:53:19 +00:00
bool visible;
2015-10-04 12:48:57 +00:00
};