Added a version of mriceblock that does not fall off ledges, title smartblock with...
authorLMH <lmh.0013@gmail.com>
Fri, 19 Jul 2013 21:20:21 +0000 (11:20 -1000)
committerLMH <lmh.0013@gmail.com>
Fri, 19 Jul 2013 21:20:45 +0000 (11:20 -1000)
data/images/creatures/mr_iceblock/left-3.png [deleted file]
data/images/creatures/mr_iceblock/mr_iceblock.sprite
data/images/creatures/mr_iceblock/smart_block/flat-left.png [new file with mode: 0644]
data/images/creatures/mr_iceblock/smart_block/left-0.png [new file with mode: 0644]
data/images/creatures/mr_iceblock/smart_block/left-1.png [new file with mode: 0644]
data/images/creatures/mr_iceblock/smart_block/left-2.png [new file with mode: 0644]
data/images/creatures/mr_iceblock/smart_block/smart_block.sprite [new file with mode: 0644]
src/badguy/mriceblock.cpp
src/badguy/mriceblock.hpp
src/supertux/object_factory.cpp

diff --git a/data/images/creatures/mr_iceblock/left-3.png b/data/images/creatures/mr_iceblock/left-3.png
deleted file mode 100644 (file)
index d4272b2..0000000
Binary files a/data/images/creatures/mr_iceblock/left-3.png and /dev/null differ
index d315dee..2a88e27 100644 (file)
@@ -5,7 +5,7 @@
          (images "left-0.png"
                  "left-1.png"
                  "left-2.png"
-                 "left-3.png"))
+                 "left-1.png"))
 
        (action (name "right")
                 (hitbox 1 6 33 32)
diff --git a/data/images/creatures/mr_iceblock/smart_block/flat-left.png b/data/images/creatures/mr_iceblock/smart_block/flat-left.png
new file mode 100644 (file)
index 0000000..2ff1dd5
Binary files /dev/null and b/data/images/creatures/mr_iceblock/smart_block/flat-left.png differ
diff --git a/data/images/creatures/mr_iceblock/smart_block/left-0.png b/data/images/creatures/mr_iceblock/smart_block/left-0.png
new file mode 100644 (file)
index 0000000..9ee55ab
Binary files /dev/null and b/data/images/creatures/mr_iceblock/smart_block/left-0.png differ
diff --git a/data/images/creatures/mr_iceblock/smart_block/left-1.png b/data/images/creatures/mr_iceblock/smart_block/left-1.png
new file mode 100644 (file)
index 0000000..02e8dce
Binary files /dev/null and b/data/images/creatures/mr_iceblock/smart_block/left-1.png differ
diff --git a/data/images/creatures/mr_iceblock/smart_block/left-2.png b/data/images/creatures/mr_iceblock/smart_block/left-2.png
new file mode 100644 (file)
index 0000000..3b8e351
Binary files /dev/null and b/data/images/creatures/mr_iceblock/smart_block/left-2.png differ
diff --git a/data/images/creatures/mr_iceblock/smart_block/smart_block.sprite b/data/images/creatures/mr_iceblock/smart_block/smart_block.sprite
new file mode 100644 (file)
index 0000000..2a88e27
--- /dev/null
@@ -0,0 +1,28 @@
+(supertux-sprite
+       (action
+         (name "left")
+         (hitbox 1 6 33 32)
+         (images "left-0.png"
+                 "left-1.png"
+                 "left-2.png"
+                 "left-1.png"))
+
+       (action (name "right")
+                (hitbox 1 6 33 32)
+               (mirror-action "left"))
+
+       (action (name "falling-left")
+               (hitbox 2 5 31.8 31.8)
+               (images "flat-left.png"))
+
+       (action (name "falling-right")
+               (hitbox 2 5 31.8 31.8)
+               (mirror-action "falling-left"))
+
+       (action (name "flat-left")
+               (hitbox 1 9 33 26)
+               (images "flat-left.png"))
+
+       (action (name "flat-right")
+               (hitbox 1 9 33 26)
+               (mirror-action "falling-left")))
index 75aac2e..fa8e0ef 100644 (file)
@@ -19,6 +19,7 @@
 #include "audio/sound_manager.hpp"
 #include "object/player.hpp"
 #include "sprite/sprite.hpp"
+#include "sprite/sprite_manager.hpp"
 #include "supertux/object_factory.hpp"
 
 #include <math.h>
@@ -289,4 +290,11 @@ MrIceBlock::is_portable() const
   return ice_state == ICESTATE_FLAT;
 }
 
+SmartBlock::SmartBlock(const Reader& reader) :
+  MrIceBlock(reader)
+{
+  max_drop_height = 16;
+  sprite = sprite_manager->create("images/creatures/mr_iceblock/smart_block/smart_block.sprite");
+}
+
 /* EOF */
index c08870b..6254527 100644 (file)
@@ -60,6 +60,12 @@ private:
   int squishcount;
 };
 
+class SmartBlock : public MrIceBlock
+{
+public:
+  SmartBlock(const Reader& reader);
+};
+
 #endif
 
 /* EOF */
index 91afa92..096e82a 100644 (file)
@@ -217,6 +217,7 @@ ObjectFactory::init_factories()
   add_factory<SkyDive>("skydive");
   add_factory<SkullyHop>("skullyhop");
   add_factory<SmartBall>("smartball");
+  add_factory<SmartBlock>("smartblock");
   add_factory<Snail>("snail");
   add_factory<SnowBall>("snowball");
   add_factory<Snowman>("snowman");