X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftrigger%2Fhatch.cpp;h=945a26737b0c8b1d6551eb1e196a1b8b3705d26b;hb=3e89eb527d5f3bca2cb8cd219784048764a148f5;hp=6019642bf2d0d589bb42bdcacf68653e96701459;hpb=51a7e63b70778ff98cb63066f618b2a9e32cb684;p=supertux.git diff --git a/src/trigger/hatch.cpp b/src/trigger/hatch.cpp index 6019642bf..945a26737 100644 --- a/src/trigger/hatch.cpp +++ b/src/trigger/hatch.cpp @@ -1,7 +1,7 @@ // $Id$ // -// SuperTux - A Jump'n Run -// Copyright (C) 2004 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -16,20 +16,18 @@ // 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 "hatch.h" -#include "gameloop.h" -#include "resources.h" -#include "object_factory.h" -#include "special/sprite.h" -#include "special/sprite_manager.h" -#include "video/drawing_context.h" -#include "app/globals.h" -#include "lisp/lisp.h" -#include "lisp/writer.h" +#include -using namespace SuperTux; +#include "hatch.hpp" +#include "game_session.hpp" +#include "resources.hpp" +#include "object_factory.hpp" +#include "sprite/sprite.hpp" +#include "sprite/sprite_manager.hpp" +#include "video/drawing_context.hpp" +#include "lisp/lisp.hpp" +#include "lisp/writer.hpp" Hatch::Hatch(const lisp::Lisp& reader) { @@ -40,7 +38,7 @@ Hatch::Hatch(const lisp::Lisp& reader) reader.get("sector", target_sector); reader.get("spawnpoint", target_spawnpoint); - sprite = sprite_manager->create("hatch"); + sprite = sprite_manager->create("images/objects/hatch/hatch.sprite"); } Hatch::Hatch(int x, int y, std::string sector, std::string spawnpoint) @@ -50,7 +48,7 @@ Hatch::Hatch(int x, int y, std::string sector, std::string spawnpoint) target_sector = sector; target_spawnpoint = spawnpoint; - sprite = sprite_manager->create("hatch"); + sprite = sprite_manager->create("images/objects/hatch/hatch.sprite"); } Hatch::~Hatch() @@ -75,10 +73,11 @@ Hatch::write(lisp::Writer& writer) } void -Hatch::action(float ) +Hatch::update(float ) { //Check if hatch animation is complete - if(sprite->check_animation()) { + if(sprite->animation_done()) { + sprite->set_action("normal"); GameSession::current()->respawn(target_sector, target_spawnpoint); } }