aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-10-17 22:21:52 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-10-17 22:21:52 -0400
commitd79f4a7f4b5aff5931ef86edd2537ef5e3620fd4 (patch)
tree2ad2d8a9ed9ffee36474fb111f4654511f0717b4 /src/world.cpp
parent03246da32a8452e6a76ccf2f7f97cda4472d1d29 (diff)
arrow rotation... kinda
Diffstat (limited to 'src/world.cpp')
-rw-r--r--src/world.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/world.cpp b/src/world.cpp
index 3455b0e..dcbc707 100644
--- a/src/world.cpp
+++ b/src/world.cpp
@@ -326,9 +326,14 @@ void WorldSystem::loader(void)
while (abcd) {
std::string tname = abcd->Name();
- if (tname == "Position")
+ if (tname == "Position") {
entity.assign<Position>(wxml, abcd);
- else if (tname == "Visible")
+ auto pos = entity.component<Position>();
+ if (pos->x == 0 && pos->y == 0) {
+ pos->x = (randGet() % static_cast<int>(world.startX * 1.9f)) + world.startX;
+ pos->y = 150;
+ }
+ } else if (tname == "Visible")
entity.assign<Visible>(wxml, abcd);
else if (tname == "Sprite")
entity.assign<Sprite>(wxml, abcd);
@@ -354,7 +359,6 @@ void WorldSystem::loader(void)
else if (tname == "Wander") {
auto script = abcd->GetText();
entity.assign<Wander>(script != nullptr ? script : "");
- //entity.component<Wander>()->script.addFunction("getpos", PlayerSystem::getPosition);
} else if (tname == "Hop")
entity.assign<Hop>();
else if (tname == "Health")