src/main.c
This commit is contained in:
parent
f893c57598
commit
d0166b0802
12
src/pong.c
12
src/pong.c
@ -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 )
|
||||
|
Loading…
Reference in New Issue
Block a user