diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-07 11:29:57 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-03-07 11:29:57 -0500 |
commit | b53826079429939cdfbda073608cb85be8ba0738 (patch) | |
tree | 3c40de4658f0cea01cd3938f07fe82788ef3dd01 /src/world.cpp | |
parent | 0751446e1d069263d25abcff49a32a380231709a (diff) | |
download | therapy-b53826079429939cdfbda073608cb85be8ba0738.tar.gz therapy-b53826079429939cdfbda073608cb85be8ba0738.tar.bz2 therapy-b53826079429939cdfbda073608cb85be8ba0738.zip |
Created entity-component system
Also tweaked the bloom flicker, tweaked the scanline texture, created a second test map, and created some currently unused sound effects.
Diffstat (limited to 'src/world.cpp')
-rw-r--r-- | src/world.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/world.cpp b/src/world.cpp new file mode 100644 index 0000000..90d9ab8 --- /dev/null +++ b/src/world.cpp | |||
@@ -0,0 +1,32 @@ | |||
1 | #include "world.h" | ||
2 | |||
3 | void World::tick() | ||
4 | { | ||
5 | for (auto it = entities.begin(); it != entities.end(); it++) | ||
6 | { | ||
7 | (*it)->tick(); | ||
8 | } | ||
9 | } | ||
10 | |||
11 | void World::input(int key, int action) | ||
12 | { | ||
13 | for (auto it = entities.begin(); it != entities.end(); it++) | ||
14 | { | ||
15 | (*it)->input(key, action); | ||
16 | } | ||
17 | } | ||
18 | |||
19 | void World::render(Texture* buffer) | ||
20 | { | ||
21 | fillTexture(buffer, NULL, 0, 0, 0); | ||
22 | |||
23 | for (auto it = entities.begin(); it != entities.end(); it++) | ||
24 | { | ||
25 | (*it)->render(buffer); | ||
26 | } | ||
27 | } | ||
28 | |||
29 | void World::addEntity(std::shared_ptr<Entity> e) | ||
30 | { | ||
31 | entities.push_back(e); | ||
32 | } | ||