30 lines
559 B
C
30 lines
559 B
C
|
#include "exit.h"
|
||
|
#include "entity.h"
|
||
|
#include "game.h"
|
||
|
#include "cfg.h"
|
||
|
#include "lzy.h"
|
||
|
#include <string.h>
|
||
|
|
||
|
static void
|
||
|
exit_draw(Entity *this, Game *g)
|
||
|
{
|
||
|
(void)g;
|
||
|
LZY_DrawSetColor(BLACK);
|
||
|
LZY_DrawRect(this->pos[0] - this->width / 2,
|
||
|
this->pos[1] - this->height / 2,
|
||
|
this->width, this->height);
|
||
|
}
|
||
|
|
||
|
void
|
||
|
exit_init(Entity *this, int x, int y)
|
||
|
{
|
||
|
memset(this, 0, sizeof(*this));
|
||
|
this->pos[0] = x;
|
||
|
this->pos[1] = y;
|
||
|
this->type = ET_EXIT;
|
||
|
this->update = NULL;
|
||
|
this->draw = exit_draw;
|
||
|
this->width = 12;
|
||
|
this->height = 12;
|
||
|
}
|