avancing
This commit is contained in:
parent
e6d229ffb1
commit
8e44c93d36
3 changed files with 5 additions and 2 deletions
4
game.c
4
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;
|
||||
}
|
||||
|
|
2
game.h
2
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;
|
||||
};
|
||||
|
||||
|
||||
|
|
1
main.c
1
main.c
|
@ -29,6 +29,7 @@ main(int argc, char *argv[])
|
|||
//get key
|
||||
//do calcs
|
||||
//collisions
|
||||
SDL_Delay(10);
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
|
Loading…
Reference in a new issue