This commit is contained in:
Frank Villaro-Dixon 2015-01-01 04:45:30 +01:00
parent e6d229ffb1
commit 8e44c93d36
3 changed files with 5 additions and 2 deletions

4
game.c
View file

@ -92,9 +92,9 @@ get_keys(struct s_game *g) {
exit(0);
if(g->keys[SDLK_LEFT])
g->cursor_angle -= 5;
g->cursor_angle -= TO_DEG(3);
if(g->keys[SDLK_RIGHT])
g->cursor_angle += 5;
g->cursor_angle += TO_DEG(3);
g->cursor_angle %= ANGLE_MAX;
}

2
game.h
View file

@ -29,6 +29,7 @@ struct s_game {
int cursor_angle; //relative to the polygon center's referential
int polygon_type; //Shape
int color;
int actual_speed;
SDL_Surface *screen;
Uint8 *keys;
@ -40,6 +41,7 @@ struct s_obstacle {
int thick;
int angle;
int distance;
int speed;
};

1
main.c
View file

@ -29,6 +29,7 @@ main(int argc, char *argv[])
//get key
//do calcs
//collisions
SDL_Delay(10);
}
return EXIT_SUCCESS;