summaryrefslogtreecommitdiff
path: root/src/box.c
blob: df4b9c7141edf3a08ac4df5f92fb983df128b29e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "entityimpl.h"
#include "lzr.h"

IMPL(draw) {
	const LZR_ImageDrawSettings stg =
		{0, 0, -1, -1, 1.0, 1.0, 0.0, true, false, false};
	LZR_DrawSetColor(1, 1, 1, 1);
	LZR_DrawImageEx(LZR_IMAGE(this->broken ? "res/boxdestroyed.bmp" : "res/box.bmp"),
	                this->pos[0], this->pos[1], stg);
}

IMPL(smash) {
	LZR_PlaySound(2 + this->broken);
	if (this->broken) {
		this->type = 0;
		this->smash = NULL;
	}
	this->broken = 1;
}

IMPL_INIT(box) {
	this->width = this->height = 64;
	this->broken = 0;
}