X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fplatform.cpp;h=0a83e15fa5b85c41cf29edec95b238f104b3275f;hb=954adaf2af9284945185e58d8017041ea1ff4868;hp=d72b7ac331052386f3c6395bb43f15bd079bb42b;hpb=6fe1f3519eecbbb75eca97c45a6697eee36b2442;p=supertux.git diff --git a/src/object/platform.cpp b/src/object/platform.cpp index d72b7ac33..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; @@ -38,7 +60,7 @@ Platform::collision(GameObject& , const CollisionHit& ) } void -Platform::action(float ) +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");