summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kdx.42@42l.fr>2023-03-19 05:01:50 +0000
committerkdx <kdx.42@42l.fr>2023-03-19 05:01:50 +0000
commit3e0db9502745a225fadd62f396c380138d7d3d80 (patch)
treeb03f1d3c93d3015f13eb06c3e472c5e06002a211
parentc44b040a906048820b0621e157601df61d2ca34e (diff)
downloadhyperultra-3e0db9502745a225fadd62f396c380138d7d3d80.tar.gz
smol player moves through time
-rw-r--r--src/player.c10
1 files 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;