diff options
Diffstat (limited to 'src/script.cpp')
-rw-r--r-- | src/script.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/script.cpp b/src/script.cpp index 0f940d3..4fda543 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -88,9 +88,10 @@ void ScriptSystem::doFile(void) void ScriptSystem::scriptExport(void) { lua.new_usertype<Position>("Position", - sol::constructors<Position(double x, double y), Position()>(), + sol::constructors<Position(float x, float y, float z), Position()>(), "x", &Position::x, - "y", &Position::y); + "y", &Position::y, + "z", &Position::z); lua.new_usertype<Name>("Name", sol::constructors<Name(std::string), Name()>(), @@ -103,7 +104,7 @@ void ScriptSystem::scriptExport(void) "flipx", &Render::flipX); lua.new_usertype<Velocity>("Velocity", - sol::constructors<Velocity(double, double), Velocity()>(), + sol::constructors<Velocity(float, float), Velocity()>(), "x", &Velocity::x, "y", &Velocity::y); @@ -119,16 +120,19 @@ void ScriptSystem::scriptExport(void) lua.new_usertype<Physics>("Physics", sol::constructors<Physics(void), Physics()>(), - "standing", &Physics::standing); + "standing", &Physics::standing, + "gravity", &Physics::gravity); lua.new_usertype<World>("World", sol::constructors<World(sol::object), World(void)>(), "Generate", &World::generate, "Seed", sol::property(&World::setSeed, &World::getSeed), - "setData", &World::setData, - "registerMaterial", &World::registerMaterial, - "setSize", &World::setSize, - "getSize", &World::getSize); + "getSize", &World::getSize, + + // New stuff + "unitSize", sol::property(&World::setUnitSize, &World::getUnitSize), + "createLayer", &World::registerLayer, + "createDecoLayer", &World::registerDecoLayer); game = lua["game"].get_or_create<sol::table>(); game.set_function("spawn", bindInstance(&ScriptSystem::spawn, this)); @@ -138,7 +142,7 @@ void ScriptSystem::scriptExport(void) sol::table ScriptSystem::spawn(sol::object param) { - sol::table* toRet; // "Entitiy" table to be returned + sol::table* toRet = NULL; // "Entitiy" table to be returned if (param.get_type() == sol::type::table) { sol::table tab = param; // Cast the generic parameter to a table |