From 3e0db9502745a225fadd62f396c380138d7d3d80 Mon Sep 17 00:00:00 2001 From: kdx Date: Sun, 19 Mar 2023 05:01:50 +0000 Subject: smol player moves through time --- src/player.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/player.c b/src/player.c index d8c2736..3b0b064 100644 --- a/src/player.c +++ b/src/player.c @@ -37,7 +37,9 @@ IMPL_UPDATE() { break; } } else if (on_ground && input_down(K_X)) { + extern double tick; this->vel[0] *= 3; + tick += 2.0; this->player.scale_x *= 1.05; } @@ -66,8 +68,8 @@ IMPL_UPDATE() { IMPL_DRAW() { LZY_DrawSetColor(BLACK); - int width = (int)(this->width / 2) * this->player.scale_x; - int height = (int)(this->height / 2) * this->player.scale_y; + int width = (int)(this->width / 2 + 1) * this->player.scale_x; + int height = (int)(this->height / 2 + 1) * this->player.scale_y; width *= 2; height *= 2; LZY_DrawRect(this->pos[0] - width / 2, @@ -76,8 +78,8 @@ IMPL_DRAW() { } IMPL_END IMPL_INIT(player) { - this->width = 12; - this->height = 12; + this->width = 10; + this->height = 10; this->player.scale_x = 1.0; this->player.scale_y = 1.0; this->player.dirx = 1; -- cgit v1.2.3