X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgworm.cpp;h=3f22adea95abfe73638eae6490bffcc8ca6b55c3;hb=ba1cd7abc93eaacc3c25c0ad1b923b2ce7b280e2;hp=efd5757324b36bcd89b8d71fe12ba6c21038f707;hpb=3694504331ca888f2cacbcb841a83c402d26934a;p=gworm.git diff --git a/src/gworm.cpp b/src/gworm.cpp index efd5757..3f22ade 100644 --- a/src/gworm.cpp +++ b/src/gworm.cpp @@ -1,11 +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 { @@ -48,10 +52,19 @@ int main(int argc, const char *argv[]) { World world(Vector(500, 500)); make_planet(world, Vector(250, 250), 220); - Entity e; - e.vel = Vector(-19, 19); - e.mass = 1; - world.AddEntity(e); + 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();