diff options
author | kdx <kikoodx@paranoici.org> | 2023-03-17 10:57:19 +0100 |
---|---|---|
committer | kdx <kikoodx@paranoici.org> | 2023-03-17 10:57:21 +0100 |
commit | 79364a7de0bd0cf7d31d1ba8a5442099ccb7b1a7 (patch) | |
tree | 3e4ed3b24b074fd393783136e7e0e2a072968580 | |
parent | ba8cb4fcea09190bbe6e80c45ef59314feea8600 (diff) | |
download | hyperultra-79364a7de0bd0cf7d31d1ba8a5442099ccb7b1a7.tar.gz |
donothing player
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/player.c | 12 |
2 files changed, 12 insertions, 2 deletions
@@ -23,10 +23,12 @@ int main(void) while (!LZY_ShouldQuit()) { LZY_CycleEvents(); + game_update(game); LZY_DrawBegin(); LZY_DrawSetColor(255, 255, 255); LZY_DrawClear(); + game_draw(game); LZY_DrawEnd(); } diff --git a/src/player.c b/src/player.c index d751857..49dddde 100644 --- a/src/player.c +++ b/src/player.c @@ -1,18 +1,24 @@ #include "player.h" #include "entity.h" #include "game.h" +#include "lzy.h" #include <string.h> static void player_update(Entity *this, Game *g) { - (void)this, (void)g; + (void)g; + this->pos[1] = this->pos[0] += 1; } static void player_draw(Entity *this, Game *g) { - (void)this, (void)g; + (void)g; + LZY_DrawSetColor(0, 0, 0); + LZY_DrawFillRect(this->pos[0] - this->width / 2, + this->pos[1] - this->height / 2, + this->width, this->height); } void @@ -22,4 +28,6 @@ player_init(Entity *this) this->type = ET_PLAYER; this->update = player_update; this->draw = player_draw; + this->width = 12; + this->height = 12; } |