diff options
author | kdx <kdx.42@42l.fr> | 2023-03-26 07:11:55 +0000 |
---|---|---|
committer | kdx <kdx.42@42l.fr> | 2023-03-26 07:11:55 +0000 |
commit | 83f5fc33df8ea2b8df661f921f157080d472a0ae (patch) | |
tree | 2862b2afa978a700f6cfa39601c6d87a9bf72260 /src/player.c | |
parent | 60b9ce29c42ac9fff81c677ab0426415046259b3 (diff) | |
download | hyperultra-83f5fc33df8ea2b8df661f921f157080d472a0ae.tar.gz |
simplify entityimpl a bit
Diffstat (limited to 'src/player.c')
-rw-r--r-- | src/player.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/player.c b/src/player.c index c6a3323..5456d0f 100644 --- a/src/player.c +++ b/src/player.c @@ -5,7 +5,7 @@ #include "rotrect.h" #include <math.h> -IMPL_UPDATE() { +IMPL(update) { const int on_ground = entity_collide(this, g, 0, 1); this->vel[0] = 2.0 * this->player.dirx; @@ -71,15 +71,15 @@ IMPL_UPDATE() { if (entity_place_meeting(this, g, entity_type("exit")) != NULL) g->queue_next_scene = true; -} IMPL_END +} -IMPL_DRAW() { +IMPL(draw) { LZY_DrawSetColor(BLACK); const double width = this->width * this->player.scale_x + 2; const double height = this->height * this->player.scale_y + 2; rotrect(this->pos[0] - 1, this->pos[1] - 1, width, height, this->player.angle); -} IMPL_END +} IMPL_INIT(player) { this->width = 10; |