summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmin Mesbah <mesbahamin@gmail.com>2017-12-14 21:48:07 -0800
committerAmin Mesbah <mesbahamin@gmail.com>2017-12-14 21:48:19 -0800
commite77b9aef0d6480380dd162a5d4c55c3942d83f12 (patch)
tree054b6468a7bac8a79377e7519949c04eda966db1
parent6ccff2e66cddee12ca3c85a2923034887a2acad9 (diff)
downloadohsp-e77b9aef0d6480380dd162a5d4c55c3942d83f12.zip
ohsp-e77b9aef0d6480380dd162a5d4c55c3942d83f12.tar.gz
Negate thrust vectors
-rw-r--r--src/game.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/game.c b/src/game.c
index 127b401..ee6c962 100644
--- a/src/game.c
+++ b/src/game.c
@@ -71,7 +71,9 @@ void game_update(struct GameState *game_state, struct GameControllerInput game_i
game_state->thrust_vector02.y = game_input.right_stick_y;
//printf("(rx: %f, ry: %f, thrust_x: %f, thrust_y: %f)\n", game_input.right_stick_x, game_input.right_stick_y, game_state->thrust_vector02.x, game_state->thrust_vector02.y);
- game_state->thrust_vector_sum = vec2d_add(game_state->thrust_vector01, game_state->thrust_vector02);
+ game_state->thrust_vector_sum = vec2d_add(
+ vec2d_negate(game_state->thrust_vector01),
+ vec2d_negate(game_state->thrust_vector02));
game_state->thrust_vector_sum = vec2d_scale(game_state->thrust_vector_sum, 0.01f);
//printf("(total_thrust_x: %f, total_thrust_y: %f)\n", game_state->thrust_vector_sum.x, game_state->thrust_vector_sum.y);