summaryrefslogtreecommitdiff
path: root/src/game.cpp
blob: 396d26a6ef3e13999ef04dde17b3569ebbbf458a (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "common.hpp"

namespace game {


class unit_t : public world::entity_t {
	
};

static render::animated_texture_t test;

class human_t : public unit_t {
	void render(render::state_t *render)
	{
		render->render(&test, bounds);
	}
};

static human_t *human;

void state_t::start(void)
{
	test.load("assets/test_", 4);

	human = new human_t;
	human->bounds.left = -0.2f;
	human->bounds.top = -0.2f;
	human->bounds.width = 3.0f;
	human->bounds.height = 3.0f;
	human->link(&world);
}

void state_t::tick(void)
{
	human->unlink();
	human->bounds.left += 0.05f;
	human->bounds.top += 0.05f;
	human->link(&world);
}

} //namespace game