+// $Id$
+//
+// SuperTux
+// Copyright (C) 2005 Matthias Braun <matze@braunis.de>
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+
#include <config.h>
-#include "platform.h"
-#include "video/drawing_context.h"
-#include "resources.h"
-#include "player.h"
-#include "special/sprite_manager.h"
-#include "utils/lispreader.h"
+#include "platform.hpp"
+#include "video/drawing_context.hpp"
+#include "resources.hpp"
+#include "player.hpp"
+#include "sprite/sprite_manager.hpp"
+#include "lisp/lisp.hpp"
+#include "lisp/writer.hpp"
+#include "object_factory.hpp"
-Platform::Platform(LispReader& reader)
+Platform::Platform(const lisp::Lisp& reader)
{
sprite = sprite_manager->create("flying_platform");
movement = Vector(0, 1);
- reader.read_float("x", bbox.p1.x);
- reader.read_float("y", bbox.p1.y);
+ reader.get("x", bbox.p1.x);
+ reader.get("y", bbox.p1.y);
bbox.set_size(sprite->get_width(), sprite->get_height());
flags |= FLAG_SOLID;
}
void
-Platform::action(float )
+Platform::update(float )
{
// just some test code...
if(state == 0) {
{
sprite->draw(context, get_pos(), LAYER_OBJECTS);
}
+
+IMPLEMENT_FACTORY(Platform, "flying_platform");