X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fplatform.cpp;h=0a83e15fa5b85c41cf29edec95b238f104b3275f;hb=954adaf2af9284945185e58d8017041ea1ff4868;hp=e1a868dad49084df0d01d6e8f8b03c5e9a11b92d;hpb=d46c78c842ab4090a3f46e560c891234167f124b;p=supertux.git diff --git a/src/object/platform.cpp b/src/object/platform.cpp index e1a868dad..0a83e15fa 100644 --- a/src/object/platform.cpp +++ b/src/object/platform.cpp @@ -1,18 +1,40 @@ +// $Id$ +// +// SuperTux +// Copyright (C) 2005 Matthias Braun +// +// 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 #include "platform.h" #include "video/drawing_context.h" #include "resources.h" #include "player.h" -#include "special/sprite_manager.h" -#include "utils/lispreader.h" +#include "sprite/sprite_manager.h" +#include "lisp/lisp.h" +#include "lisp/writer.h" +#include "object_factory.h" -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; @@ -26,7 +48,7 @@ Platform::~Platform() } HitResponse -Platform::collision(GameObject& object, const CollisionHit& hit) +Platform::collision(GameObject& , const CollisionHit& ) { #if 0 if(typeid(object) == typeid(Player)) { @@ -38,7 +60,7 @@ Platform::collision(GameObject& object, const CollisionHit& hit) } void -Platform::action(float elapsed_time) +Platform::update(float ) { // just some test code... if(state == 0) { @@ -73,3 +95,5 @@ Platform::draw(DrawingContext& context) { sprite->draw(context, get_pos(), LAYER_OBJECTS); } + +IMPLEMENT_FACTORY(Platform, "flying_platform");