src/main.c

This commit is contained in:
Pradana AUMARS 2021-06-29 16:23:02 +02:00
parent f893c57598
commit d0166b0802

View File

@ -102,7 +102,19 @@ Ball_move(Ball *b, Pong *p)
void
Pong_run(Pong *p) {
int start = false;
int quit = false;
Pong_render(p);
while (!start) {
printf("Press any key to start...\r");
fflush(stdout);
while( SDL_PollEvent( &(p->e) ) != 0 )
{
if( p->e.type == SDL_KEYDOWN) start = true;
}
}
putc('\n', stdout);
while (!quit) {
while( SDL_PollEvent( &(p->e) ) != 0 )