Major rewrite of scripting support:
[supertux.git] / src / object / infoblock.cpp
index 55e2e30..1300bd4 100644 (file)
 
 #include <config.h>
 
-#include "infoblock.h"
-#include "game_session.h"
-#include "resources.h"
-#include "sprite/sprite_manager.h"
-#include "object_factory.h"
-#include "lisp/lisp.h"
-#include "sector.h"
+#include "infoblock.hpp"
+#include "game_session.hpp"
+#include "resources.hpp"
+#include "sprite/sprite_manager.hpp"
+#include "object_factory.hpp"
+#include "lisp/lisp.hpp"
+#include "sector.hpp"
+#include "msg.hpp"
 
 InfoBlock::InfoBlock(const lisp::Lisp& lisp)
-  : Block(sprite_manager->create("infoblock"))
+  : Block(sprite_manager->create("images/objects/bonus_block/infoblock.sprite"))
 {
   Vector pos;
   lisp.get("x", pos.x);
@@ -37,11 +38,11 @@ InfoBlock::InfoBlock(const lisp::Lisp& lisp)
   bbox.set_pos(pos);
 
   if(!lisp.get("message", message)) {
-    std::cerr << "No message in InfoBlock!\n";
+    msg_warning << "No message in InfoBlock" << std::endl;
   }
-  stopped = false;
-  ringing = new AmbientSound(get_pos(), 0.5, 300, 1, "phone");
-  Sector::current()->add_object(ringing);  
+  //stopped = false;
+  //ringing = new AmbientSound(get_pos(), 0.5, 300, 1, "sounds/phone.wav");
+  //Sector::current()->add_object(ringing);  
 }
 
 InfoBlock::~InfoBlock()
@@ -51,12 +52,12 @@ InfoBlock::~InfoBlock()
 void
 InfoBlock::hit(Player& )
 {
-  GameSession::current()->display_info_box(message);
   start_bounce();
-  if (!stopped) {
-    ringing->remove_me();
-    stopped = true;
-  }
+  //if (!stopped) {
+  //  ringing->remove_me();
+  //  stopped = true;
+  //}
+  GameSession::current()->display_info_box(message);
 }
 
 IMPLEMENT_FACTORY(InfoBlock, "infoblock")