X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Forbi.cpp;h=87e3866645203e08941b5bec2db69497386b3456;hb=a73a6dd63407b5f5ef5b0c635551ad27b27c95d6;hp=67409e6888f9122a0aeca50389ed24ba44c1f59b;hpb=aa28d59d492c490194e8e8f7af086fcb531d170a;p=orbi.git diff --git a/src/orbi.cpp b/src/orbi.cpp index 67409e6..87e3866 100644 --- a/src/orbi.cpp +++ b/src/orbi.cpp @@ -5,6 +5,7 @@ #include "graphics/Canvas.h" #include "graphics/Window.h" #include "world/AABB.h" +#include "world/Character.h" #include "world/Entity.h" #include "world/Tile.h" #include "world/Tileset.h" @@ -52,12 +53,14 @@ int main(int argc, const char *argv[]) { world.SetTile(Vector(2, 9), Tile(0)); world.SetTile(Vector(3, 9), Tile(0)); - Entity e; - e.bounds = AABB(0, 0, 2, 3); - e.vbox = AABB(.1, 0, 1.8, 3); - e.hbox = AABB(0, .1, 2, 1.8); - e.Move(Vector(5, 0)); - world.AddEntity(e); + Character player; + player.bounds = AABB(0, 0, 2, 3); + player.vbox = AABB(.1, 0, 1.8, 3); + player.hbox = AABB(0, .1, 2, 1.8); + player.arm = AABB(.5, 1.4, 1, .5); + player.armOrigin = Vector(1.4, 1.65); + player.Move(Vector(5, 0)); + world.AddEntity(player); Entity mob; mob.bounds = AABB(0, 0, 2, 1.5); @@ -67,7 +70,7 @@ int main(int argc, const char *argv[]) { world.AddEntity(mob); Application app(canv, world, tiles); - app.Control(e); + app.Control(player); app.Run(); return 0;