a-game

2D platformer written from scratch.
git clone git://git.amin.space/a-game.git
Log | Files | Refs | README | LICENSE

commit d4de91463dc441cd190bff9b2f0006429459b58f
parent dc5a067fa4d7ce0e02ce82fc83615771ebb0b696
Author: amin <dev@aminmesbah.com>
Date:   Sun, 14 Apr 2019 01:31:58 +0000

Put the world-space origin in the lower left

FossilOrigin-Name: 024567106dfdccb4bdee8ab4618f7ccf4d9c655294059d98ec681067706b66b2
Diffstat:
Msrc/game.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/game.c b/src/game.c @@ -193,11 +193,11 @@ void game_update_and_render(struct GameState *game_state, f32 dt, v2u framebuffe if (input.key_up) { - game_state->player.pos.y -= movement_speed; + game_state->player.pos.y += movement_speed; } else if (input.key_down) { - game_state->player.pos.y += movement_speed; + game_state->player.pos.y -= movement_speed; } if (input.key_left) @@ -231,7 +231,7 @@ void game_update_and_render(struct GameState *game_state, f32 dt, v2u framebuffe v3 color = (v3) { 1.0f, 0.0f, 1.0f }; shader_setv3(&game_state->tiles.shader, "color", &color); - m4 projection = glmth_projection_ortho(0.0f, framebuffer.width, framebuffer.height, 0.0f, -1.0f, 0.0f); + m4 projection = glmth_projection_ortho(0.0f, framebuffer.width, 0.0f, framebuffer.height, -1.0f, 0.0f); shader_setm4(&game_state->tiles.shader, "projection", &projection); glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);