From d79f4a7f4b5aff5931ef86edd2537ef5e3620fd4 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 17 Oct 2017 22:21:52 -0400 Subject: arrow rotation... kinda --- src/world.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/world.cpp') 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(wxml, abcd); - else if (tname == "Visible") + auto pos = entity.component(); + if (pos->x == 0 && pos->y == 0) { + pos->x = (randGet() % static_cast(world.startX * 1.9f)) + world.startX; + pos->y = 150; + } + } else if (tname == "Visible") entity.assign(wxml, abcd); else if (tname == "Sprite") entity.assign(wxml, abcd); @@ -354,7 +359,6 @@ void WorldSystem::loader(void) else if (tname == "Wander") { auto script = abcd->GetText(); entity.assign(script != nullptr ? script : ""); - //entity.component()->script.addFunction("getpos", PlayerSystem::getPosition); } else if (tname == "Hop") entity.assign(); else if (tname == "Health") -- cgit v1.2.3