mirror of
https://github.com/lov3b/Pong.git
synced 2025-01-18 20:50:12 +01:00
faster paddles and offset
This commit is contained in:
parent
a67b8378ac
commit
9c77a9fde6
@ -6,7 +6,7 @@
|
|||||||
PlayerPaddle::PlayerPaddle(const SDL_Point *screen, const Side side) : SDL_Rect(), screen(screen) {
|
PlayerPaddle::PlayerPaddle(const SDL_Point *screen, const Side side) : SDL_Rect(), screen(screen) {
|
||||||
w = 20;
|
w = 20;
|
||||||
h = 80;
|
h = 80;
|
||||||
x = side == Side::LEFT ? 0 : screen->x - w;
|
x = side == Side::LEFT ? 20 : screen->x - w-20;
|
||||||
y = (screen->y - h) / 2;
|
y = (screen->y - h) / 2;
|
||||||
|
|
||||||
color[0] = 255;
|
color[0] = 255;
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
class PlayerPaddle : public SDL_Rect {
|
class PlayerPaddle : public SDL_Rect {
|
||||||
private:
|
private:
|
||||||
static const int MOVE_PER_TICK = 5;
|
static const int MOVE_PER_TICK = 7;
|
||||||
const SDL_Point *screen;
|
const SDL_Point *screen;
|
||||||
bool movingUp = false, movingDown = false;
|
bool movingUp = false, movingDown = false;
|
||||||
uint8_t color[4]{};
|
uint8_t color[4]{};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user