* Coins inside boxes are now being counted. (We'll have to decide if we want the...
[supertux.git] / src / object / block.cpp
index 4c34fd6..de4f311 100644 (file)
 #include "object_factory.hpp"
 #include "lisp/list_iterator.hpp"
 #include "object_factory.hpp"
+#include "level.hpp"
 
-static const float BOUNCY_BRICK_MAX_OFFSET=8;
-static const float BOUNCY_BRICK_SPEED=90;
-static const float EPSILON = .0001;
+static const float BOUNCY_BRICK_MAX_OFFSET = 8;
+static const float BOUNCY_BRICK_SPEED = 90;
+static const float EPSILON = .0001f;
 
 Block::Block(Sprite* newsprite)
-  : sprite(newsprite), bouncing(false), bounce_dir(0), bounce_offset(0)
+  : sprite(newsprite), bouncing(false), breaking(false), bounce_dir(0), bounce_offset(0)
 {
-  bbox.set_size(32, 32.1);
+  bbox.set_size(32, 32.1f);
   set_group(COLGROUP_STATIC);
   sound_manager->preload("sounds/upgrade.wav");
   sound_manager->preload("sounds/brick.wav");
@@ -243,6 +244,7 @@ BonusBlock::try_open()
     case CONTENT_COIN:
       Sector::current()->add_object(new BouncyCoin(get_pos()));
       player.get_status()->add_coins(1);
+      Sector::current()->get_level()->stats.coins++;
       break;
 
     case CONTENT_FIREGROW: