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;
+}
+