X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Forbi.cpp;h=91974974704d67bd939023a8c9fe468af36fa733;hb=7cf057b5b3a28c3896af27cb725fbf0b4f1459c2;hp=42ee9109f450c8f4e3e61dd11be42cdb49bfb077;hpb=79a34acdc1beff20213f03c326a4aa03c5d47c92;p=orbi.git diff --git a/src/orbi.cpp b/src/orbi.cpp index 42ee910..9197497 100644 --- a/src/orbi.cpp +++ b/src/orbi.cpp @@ -32,7 +32,7 @@ int main(int argc, const char *argv[]) { Tileset tiles( canv.LoadTexture(sdl.GetBasePath() + "../../data/test-tile.png"), - Vector(32, 32) + Vector(16, 16) ); World world(Vector(10, 10)); @@ -48,11 +48,26 @@ int main(int argc, const char *argv[]) { world.SetTile(Vector(9, 5), Tile(0)); world.SetTile(Vector(9, 6), Tile(0)); + world.SetTile(Vector(3, 8), Tile(0)); + world.SetTile(Vector(2, 9), Tile(0)); + world.SetTile(Vector(3, 9), Tile(0)); + Entity e; - e.Bounds() = AABB(Vector(5, 2), Vector(2, 3)); - world.AddEntity(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)); + 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(1, 0)); + world.AddEntity(mob); Application app(canv, world, tiles); + app.Control(player); app.Run(); return 0;