commit 3207429f3cd345e4782e6d03bf2c1d2a7d065bff
parent 726a65405e45e908d10369db84a124d4664ca727
Author: Amin Mesbah <dev@aminmesbah.com>
Date: Sun, 31 Mar 2019 18:52:02 -0700
Make player smaller
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/game.c b/src/game.c
@@ -110,6 +110,9 @@ void game_update_and_render(struct GameState *game_state, f32 dt, v2u framebuffe
//glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ // In Knytt, the player is a 9 by 14 pixels and a tile is 24 by 24 pixels
+ // TODO: Use world coordinates for everything other than rendering
+
// render tiles
{
glBindVertexArray(game_state->tiles.vao);
@@ -206,7 +209,7 @@ void game_update_and_render(struct GameState *game_state, f32 dt, v2u framebuffe
glBindVertexArray(game_state->tiles.vao);
m4 model = glmth_m4_init_id();
model = glmth_translate(model, (v3) { player.pos.x, player.pos.y, 0.0f });
- model = glmth_scale(model, (v3) {15.0f, 30.0f, 1.0f});
+ model = glmth_scale(model, (v3) { 9.0f, 14.0f, 1.0f });
shader_setm4(&game_state->tiles.shader, "model", &model);
v3 color = (v3) { 1.0f, 0.0f, 1.0f };
shader_setv3(&game_state->tiles.shader, "color", &color);