rotagon/main.c
Frank Villaro-Dixon 9fd08a1145 obstacles
2015-01-01 05:32:07 +01:00

45 lines
612 B
C

/*
** main.c - Rotagon
**
** 2014 - Frank Villaro-Dixon <Frank@Villaro-Dixon.eu>
*/
#include <stdio.h>
#include <stdlib.h>
#include "SDL/SDL.h"
#include "game.h"
#include "sdl.h"
#include "obs.h"
int
main()
{
struct s_game ga;
start:
init_game(&ga);
init_SDL(&ga);
struct s_obstacle a = create_obstacle(SHAPE_THICK, 2, 1);
add_obstacle(&ga, a);
while(1) {
SDL_FillRect(ga.screen, NULL, 0);
if(!(ga.counter % 50)) {
add_random_obstacle(&ga);
}
update_obstacles(&ga);
draw_game(&ga);
SDL_Flip(ga.screen);
get_keys(&ga);
SDL_Delay(10);
ga.counter++;
}
return EXIT_SUCCESS;
}