Rackets initialise in the middle

This commit is contained in:
Pradana AUMARS 2021-06-28 15:11:59 +02:00
parent c5e8473d79
commit b0d7f5cc48

View File

@ -11,8 +11,8 @@ Pong_init() {
*(int *)&p->SCREEN_HEIGHT = 480; *(int *)&p->SCREEN_HEIGHT = 480;
p->ball = Ball_init(p->SCREEN_WIDTH, p->SCREEN_HEIGHT, 100); p->ball = Ball_init(p->SCREEN_WIDTH, p->SCREEN_HEIGHT, 100);
p->racketL = Racket_init(p->SCREEN_WIDTH, p->SCREEN_HEIGHT, 50, 50, SDL_SCANCODE_E, SDL_SCANCODE_D); p->racketL = Racket_init(p->SCREEN_WIDTH, p->SCREEN_HEIGHT, 50, p->SCREEN_HEIGHT/2, SDL_SCANCODE_E, SDL_SCANCODE_D);
p->racketR = Racket_init(p->SCREEN_WIDTH, p->SCREEN_HEIGHT, p->SCREEN_WIDTH - 50, 50, SDL_SCANCODE_I, SDL_SCANCODE_K); p->racketR = Racket_init(p->SCREEN_WIDTH, p->SCREEN_HEIGHT, p->SCREEN_WIDTH - 50, p->SCREEN_HEIGHT/2, SDL_SCANCODE_I, SDL_SCANCODE_K);
p->window = SDL_CreateWindow( "Pong", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, p->SCREEN_WIDTH, p->SCREEN_HEIGHT, SDL_WINDOW_SHOWN ); p->window = SDL_CreateWindow( "Pong", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, p->SCREEN_WIDTH, p->SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
if( p->window == NULL ) if( p->window == NULL )