X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject_factory.cpp;h=667a12f36ceaa3fb4e7fe22e5045508914860c69;hb=c75799590ba936c673bea467b65518c3c2c2e284;hp=fe89724c440ec1e674ac74d5b051df611cd973bd;hpb=fea3446f05e1e7673607b835c269d3e8d1929ab3;p=supertux.git diff --git a/src/object_factory.cpp b/src/object_factory.cpp index fe89724c4..667a12f36 100644 --- a/src/object_factory.cpp +++ b/src/object_factory.cpp @@ -42,13 +42,27 @@ GameObject* create_object(const std::string& name, const lisp::Lisp& reader) GameObject* create_object(const std::string& name, const Vector& pos) { std::stringstream lisptext; - lisptext << "(" << name - << " (x " << pos.x << ")" + lisptext << "((x " << pos.x << ")" << " (y " << pos.y << "))"; lisp::Parser parser; const lisp::Lisp* lisp = parser.parse(lisptext, "create_object"); - GameObject* object = create_object(name, *lisp); + GameObject* object = create_object(name, *(lisp->get_car())); return object; } + +GameObject* create_badguy_object(const std::string& name, const Vector& pos, const Direction dir) +{ + std::stringstream lisptext; + lisptext << "((x " << pos.x << ")" + << " (y " << pos.y << ")" + << " (direction " << dir << "))"; + + lisp::Parser parser; + const lisp::Lisp* lisp = parser.parse(lisptext, "create_object"); + GameObject* object = create_object(name, *(lisp->get_car())); + + return object; +} +