]> git.localhorst.tv Git - orbi.git/blobdiff - src/orbi.cpp
entity/entity collision stub
[orbi.git] / src / orbi.cpp
index b05244189b05a5c9535fee342f1cde49eb522d92..fae15e87e8b53d9d09ac7796a5131da7b5682dd2 100644 (file)
@@ -48,10 +48,24 @@ int main(int argc, const char *argv[]) {
        world.SetTile(Vector<int>(9, 5), Tile(0));
        world.SetTile(Vector<int>(9, 6), Tile(0));
 
+       world.SetTile(Vector<int>(3, 8), Tile(0));
+       world.SetTile(Vector<int>(2, 9), Tile(0));
+       world.SetTile(Vector<int>(3, 9), Tile(0));
+
        Entity e;
-       e.bounds = AABB(Vector<float>(5, 0), Vector<float>(2, 3));
+       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<float>(5, 0));
        Entity &player = world.AddEntity(e);
 
+       Entity mob;
+       mob.bounds = AABB(0, 0, 2, 1.5);
+       mob.vbox = mob.bounds;
+       mob.hbox = mob.bounds;
+       mob.Move(Vector<float>(1, 0));
+       world.AddEntity(mob);
+
        Application app(canv, world, tiles);
        app.Control(player);
        app.Run();