]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
oh yeah that
authorClyne Sullivan <tullivan99@gmail.com>
Thu, 20 Oct 2016 13:01:28 +0000 (09:01 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Thu, 20 Oct 2016 13:01:28 +0000 (09:01 -0400)
include/entities.hpp [new file with mode: 0644]
src/entities.cpp [new file with mode: 0644]
src/world.cpp

diff --git a/include/entities.hpp b/include/entities.hpp
new file mode 100644 (file)
index 0000000..f7c3894
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef ENTITIES_HPP_
+#define ENTITIES_HPP_
+
+void entityxTest();
+
+#endif // ENTITIES_HPP_
diff --git a/src/entities.cpp b/src/entities.cpp
new file mode 100644 (file)
index 0000000..d07de4b
--- /dev/null
@@ -0,0 +1,21 @@
+#include <entities.hpp>
+
+#include <engine.hpp>
+#include <components.hpp>
+
+void entityxTest(void)
+{
+       entityx::Entity e = game::entities.create();
+       e.assign<Position>(100.0f, 100.0f);
+       e.assign<Direction>(0.0f, 0.0f);
+       
+       e = game::entities.create();
+       e.assign<Position>(0.0f, 100.0f);
+       e.assign<Direction>(-0.01f, 0.0f);
+       e.assign<Visible>(-.2f);
+       auto sprite_h = e.assign<Sprite>();
+       sprite_h->addSpriteSegment(SpriteData(game::sprite_l.loadSprite("assets/cat.png"),
+                                                                                 vec2(0, 0),
+                                                                                 vec2(19, 15)),
+                                                                                 vec2(0, 0));
+}
index 2772160c6d58781720b9664ab46c9102d4083c9e..15fde50c2138d0432234ea76ab508ed9e4106702 100644 (file)
@@ -299,6 +299,11 @@ void WorldSystem::load(const std::string& file)
             game::time::setTickCount(std::stoi(wxml->GetText()));
         }
 
+               // hill creation
+               /*else if (tagName == "hill") {
+                       addHill(ivec2 { wxml->IntAttribute("peakx"), wxml->IntAttribute("peaky") }, wxml->UnsignedAttribute("width"));
+               }*/
+
                wxml = wxml->NextSiblingElement();              
        }
 }