Made SpriteParticle's action configurable
[supertux.git] / src / trigger / hatch.cpp
index 8e264df..945a267 100644 (file)
@@ -1,7 +1,7 @@
 //  $Id$
 //
-//  SuperTux -  A Jump'n Run
-//  Copyright (C) 2004 Matthias Braun <matze@braunis.de
+//  SuperTux
+//  Copyright (C) 2006 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
 //  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 "hatch.h"
-#include "game_session.h"
-#include "resources.h"
-#include "object_factory.h"
-#include "sprite/sprite.h"
-#include "sprite/sprite_manager.h"
-#include "video/drawing_context.h"
-#include "lisp/lisp.h"
-#include "lisp/writer.h"
+#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)
 {
@@ -37,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)
@@ -47,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()
@@ -72,10 +73,10 @@ 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);
   }