ohsp

Prototype for a game with dual thruster controls.
git clone git://git.amin.space/ohsp.git
Log | Files | Refs | LICENSE

commit 02d97d122f9ab48578d0a30fd042f8c933d038ee
parent 362265b50f915208ac6320cae696beb273202db5
Author: amin <dev@aminmesbah.com>
Date:   Fri, 15 Dec 2017 05:48:18 +0000

Negate thrust vectors

FossilOrigin-Name: 622ca82f79925b17a63693aade0dc26092a544386e261a048b4d27fc0f36e77c
Diffstat:
Msrc/game.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 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);