X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgworm.cpp;h=3f22adea95abfe73638eae6490bffcc8ca6b55c3;hb=ba1cd7abc93eaacc3c25c0ad1b923b2ce7b280e2;hp=5f35fd956803250dd1b884b8ac233a1106b298b9;hpb=587986123da991c9d640d43f26a8c7035cd7cec5;p=gworm.git diff --git a/src/gworm.cpp b/src/gworm.cpp index 5f35fd9..3f22ade 100644 --- a/src/gworm.cpp +++ b/src/gworm.cpp @@ -1,10 +1,15 @@ #include "app/Application.h" #include "app/SDL.h" +#include "graphics/const.h" #include "graphics/Canvas.h" #include "graphics/Window.h" +#include "world/Entity.h" #include "world/World.h" +#include + using namespace gworm; +using namespace std; namespace { @@ -47,6 +52,20 @@ int main(int argc, const char *argv[]) { World world(Vector(500, 500)); make_planet(world, Vector(250, 250), 220); + Entity orb; + orb.vel = Vector(-19, 19); + orb.mass = 1; + world.AddEntity(orb); + + Entity coll; + coll.pos = Vector(250, -25); + coll.vel = Vector(-10, 0); + coll.mass = 2; + world.AddEntity(coll); + + cout << "normal at top: " << world.NormalAt(Vector(250, 30)) << endl; + cout << "normal at left: " << world.NormalAt(Vector(30, 250)) << endl; + Application app(canv, world); app.Run();