summaryrefslogtreecommitdiff
path: root/src/game.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/game.c b/src/game.c
index b067fb4..946d53a 100644
--- a/src/game.c
+++ b/src/game.c
@@ -44,6 +44,11 @@ void game_update(struct GameState *game_state, struct GameControllerInput game_i
game_input.left_stick_y,
game_state->thrust_vector.angle,
game_state->thrust_vector.length);
+
+ struct Entity *player = &game_state->player;
+ entity_accelerate(player, game_state->thrust_vector.angle, game_state->thrust_vector.length * 0.001);
+ player->x += player->speed * cos(player->angle);
+ player->y += player->speed * sin(player->angle);
}
@@ -61,6 +66,11 @@ void game_render(struct OffscreenBuffer *buffer, float dt, struct GameState *gam
player.y + (game_state->thrust_vector.length * sin(game_state->thrust_vector.angle)),
10,
0x0000FF);
+ game_render_circle(buffer,
+ player.x + 100 * (player.speed * cos(player.angle)),
+ player.y + 100 * (player.speed * sin(player.angle)),
+ 10,
+ 0xFF00FF);
}