summaryrefslogtreecommitdiff
path: root/src/player.c
blob: b51572b400e3309fca68f45e068a0c08d71bef1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;
}