Fixed code that broke due to changes to Rectf and Sizef
[supertux.git] / src / object / bonus_block.hpp
index 98eb747..5dd506e 100644 (file)
@@ -1,5 +1,5 @@
 //  SuperTux
-//  Copyright (C) 2009 Ingo Ruhnke <grumbel@gmx.de>
+//  Copyright (C) 2009 Ingo Ruhnke <grumbel@gmail.com>
 //
 //  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
@@ -18,6 +18,7 @@
 #define HEADER_SUPERTUX_OBJECT_BONUS_BLOCK_HPP
 
 #include "object/block.hpp"
+#include "object/moving_sprite.hpp"
 
 class BonusBlock : public Block
 {
@@ -27,7 +28,8 @@ public:
   virtual ~BonusBlock();
   HitResponse collision(GameObject& other, const CollisionHit& hit);
 
-  void try_open();
+  void try_open(Player *player);
+  void try_drop(Player *player);
 
   enum Contents {
     CONTENT_COIN,
@@ -35,7 +37,12 @@ public:
     CONTENT_ICEGROW,
     CONTENT_STAR,
     CONTENT_1UP,
-    CONTENT_CUSTOM
+    CONTENT_CUSTOM,
+    CONTENT_SCRIPT,
+    CONTENT_LIGHT,
+    CONTENT_TRAMPOLINE,
+    CONTENT_RAIN,
+    CONTENT_EXPLODE
   };
 
 protected:
@@ -44,10 +51,15 @@ protected:
 public:
   Contents contents;
   MovingObject* object;
+  int hit_counter;
+  void draw(DrawingContext& context);
 
 private:
   BonusBlock(const BonusBlock&);
   BonusBlock& operator=(const BonusBlock&);
+  std::string sprite_name;
+  std::string script;
+  SurfacePtr lightsprite;
 };
 
 #endif