From: LMH Date: Fri, 19 Jul 2013 21:20:21 +0000 (-1000) Subject: Added a version of mriceblock that does not fall off ledges, title smartblock with... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f9e48410db28cb4bd1b91fa46414be660d3f5f8b;p=supertux.git Added a version of mriceblock that does not fall off ledges, title smartblock with an ugly recolored sprite. --- diff --git a/data/images/creatures/mr_iceblock/left-3.png b/data/images/creatures/mr_iceblock/left-3.png deleted file mode 100644 index d4272b2b7..000000000 Binary files a/data/images/creatures/mr_iceblock/left-3.png and /dev/null differ diff --git a/data/images/creatures/mr_iceblock/mr_iceblock.sprite b/data/images/creatures/mr_iceblock/mr_iceblock.sprite index d315dee63..2a88e277b 100644 --- a/data/images/creatures/mr_iceblock/mr_iceblock.sprite +++ b/data/images/creatures/mr_iceblock/mr_iceblock.sprite @@ -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 index 000000000..2ff1dd5d5 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 index 000000000..9ee55ab09 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 index 000000000..02e8dce5b 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 index 000000000..3b8e35108 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 index 000000000..2a88e277b --- /dev/null +++ b/data/images/creatures/mr_iceblock/smart_block/smart_block.sprite @@ -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"))) diff --git a/src/badguy/mriceblock.cpp b/src/badguy/mriceblock.cpp index 75aac2e2e..fa8e0efd3 100644 --- a/src/badguy/mriceblock.cpp +++ b/src/badguy/mriceblock.cpp @@ -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 @@ -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 */ diff --git a/src/badguy/mriceblock.hpp b/src/badguy/mriceblock.hpp index c08870b1c..6254527ef 100644 --- a/src/badguy/mriceblock.hpp +++ b/src/badguy/mriceblock.hpp @@ -60,6 +60,12 @@ private: int squishcount; }; +class SmartBlock : public MrIceBlock +{ +public: + SmartBlock(const Reader& reader); +}; + #endif /* EOF */ diff --git a/src/supertux/object_factory.cpp b/src/supertux/object_factory.cpp index 91afa928b..096e82a8d 100644 --- a/src/supertux/object_factory.cpp +++ b/src/supertux/object_factory.cpp @@ -217,6 +217,7 @@ ObjectFactory::init_factories() add_factory("skydive"); add_factory("skullyhop"); add_factory("smartball"); + add_factory("smartblock"); add_factory("snail"); add_factory("snowball"); add_factory("snowman");