diff options
Diffstat (limited to 'src/player.c')
-rw-r--r-- | src/player.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/player.c b/src/player.c new file mode 100644 index 0000000..b51572b --- /dev/null +++ b/src/player.c @@ -0,0 +1,17 @@ +#include "entityimpl.h" + +IMPL(draw) { + LZR_DrawSetColor(1, 1, 1, 1); + LZR_DrawRectangle(true, this->pos[0] - this->width / 2, + this->pos[1] - this->height / 2, + this->width, this->height); +} + +IMPL(update) { + this->vel[0] = LZR_BUTTON(RIGHT) - LZR_BUTTON(LEFT); + entity_move(this, g); +} + +IMPL_INIT(player) { + this->height = this->width = 12; +} |