34 lines
422 B
C
34 lines
422 B
C
#include "player.h"
|
|
#include "draw.h"
|
|
|
|
static void player_reset_speed(Player *);
|
|
|
|
void
|
|
player_init(Player *p)
|
|
{
|
|
p->pos.x = 0;
|
|
p->pos.y = 0;
|
|
player_reset_speed(p);
|
|
}
|
|
|
|
void
|
|
player_update(Player *p)
|
|
{
|
|
p->pos.x++;
|
|
}
|
|
|
|
void
|
|
player_draw(Player *p)
|
|
{
|
|
draw_rectangle(C_WHITE, p->pos.x, p->pos.y, 16, 16);
|
|
}
|
|
|
|
static void
|
|
player_reset_speed(Player *p)
|
|
{
|
|
p->spd.x = 0.0f;
|
|
p->spd.y = 0.0f;
|
|
p->rem.x = 0.0f;
|
|
p->rem.y = 0.0f;
|
|
}
|