diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-06-26 19:59:28 -0400 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2015-06-26 19:59:28 -0400 |
commit | 428c401f9c1053f7e13ffe641758dfb72791d8dc (patch) | |
tree | 3b7c74e0346db3d08319e309c37e975e19395d74 /src/main.cpp | |
parent | 55c8a14a7e2b2dadf0def3e09f970818164366f5 (diff) | |
download | therapy-428c401f9c1053f7e13ffe641758dfb72791d8dc.tar.gz therapy-428c401f9c1053f7e13ffe641758dfb72791d8dc.tar.bz2 therapy-428c401f9c1053f7e13ffe641758dfb72791d8dc.zip |
Player now moves
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/main.cpp b/src/main.cpp index dcf8d87..35749f5 100644 --- a/src/main.cpp +++ b/src/main.cpp | |||
@@ -3,10 +3,7 @@ | |||
3 | #include <cstdlib> | 3 | #include <cstdlib> |
4 | #include "renderer.h" | 4 | #include "renderer.h" |
5 | #include "muxer.h" | 5 | #include "muxer.h" |
6 | #include "entity_manager.h" | 6 | #include "game.h" |
7 | #include "components/sprite_renderable.h" | ||
8 | #include "components/transformable.h" | ||
9 | #include "systems/rendering.h" | ||
10 | 7 | ||
11 | int main() | 8 | int main() |
12 | { | 9 | { |
@@ -19,24 +16,8 @@ int main() | |||
19 | 16 | ||
20 | // Put this in a block so game goes out of scope before we destroy the renderer | 17 | // Put this in a block so game goes out of scope before we destroy the renderer |
21 | { | 18 | { |
22 | EntityManager manager; | 19 | Game game {window}; |
23 | 20 | game.execute(); | |
24 | int player = manager.emplaceEntity(); | ||
25 | manager.emplaceComponent<SpriteRenderableComponent>(player, "res/Starla.png", 10, 12, 6); | ||
26 | manager.emplaceComponent<TransformableComponent>(player, 203, 44, 10, 12); | ||
27 | |||
28 | std::list<std::unique_ptr<System>> loop; | ||
29 | loop.push_back(std::unique_ptr<System>(new RenderingSystem())); | ||
30 | |||
31 | while (!glfwWindowShouldClose(window)) | ||
32 | { | ||
33 | for (auto& sys : loop) | ||
34 | { | ||
35 | sys->tick(manager, 1.0); | ||
36 | } | ||
37 | |||
38 | glfwPollEvents(); | ||
39 | } | ||
40 | } | 21 | } |
41 | 22 | ||
42 | destroyMuxer(); | 23 | destroyMuxer(); |