smol player moves through time

This commit is contained in:
kdx 2023-03-19 05:01:50 +00:00
parent c44b040a90
commit 3e0db95027
1 changed files with 6 additions and 4 deletions

View File

@ -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;