From 8e44c93d36b02fee9304f1a868f91eac764fb34c Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Thu, 1 Jan 2015 04:45:30 +0100 Subject: [PATCH] avancing --- game.c | 4 ++-- game.h | 2 ++ main.c | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/game.c b/game.c index d9ab2a7..fc4f6f4 100644 --- a/game.c +++ b/game.c @@ -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; } diff --git a/game.h b/game.h index fa8a2df..c58d3e5 100644 --- a/game.h +++ b/game.h @@ -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; }; diff --git a/main.c b/main.c index 4c741c0..f0466a7 100644 --- a/main.c +++ b/main.c @@ -29,6 +29,7 @@ main(int argc, char *argv[]) //get key //do calcs //collisions + SDL_Delay(10); } return EXIT_SUCCESS;