From: LMH Date: Sat, 29 Nov 2014 22:58:22 +0000 (-1000) Subject: Icecrusher crushes bricks. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=9cc4d589790a6b32ebdc982a1a4d67b3136b67c4;p=supertux.git Icecrusher crushes bricks. --- diff --git a/src/object/brick.cpp b/src/object/brick.cpp index fc48dd537..d1158c148 100644 --- a/src/object/brick.cpp +++ b/src/object/brick.cpp @@ -21,6 +21,7 @@ #include "object/bouncy_coin.hpp" #include "object/explosion.hpp" #include "object/flower.hpp" +#include "object/icecrusher.hpp" #include "object/player.hpp" #include "object/portable.hpp" #include "sprite/sprite_manager.hpp" @@ -76,6 +77,9 @@ Brick::collision(GameObject& other, const CollisionHit& hit_){ if(explosion && explosion->hurts()) { try_break(player); } + IceCrusher* icecrusher = dynamic_cast (&other); + if(icecrusher && coin_counter == 0) + try_break(player); return Block::collision(other, hit_); } diff --git a/src/object/icecrusher.cpp b/src/object/icecrusher.cpp index 1e94d656e..72220a40a 100644 --- a/src/object/icecrusher.cpp +++ b/src/object/icecrusher.cpp @@ -149,11 +149,11 @@ IceCrusher::collision_solid(const CollisionHit& hit) { Sector::current()->add_object(std::make_shared( Vector(get_bbox().p2.x - j*8 - 4, get_bbox().p2.y), - 0, 90-5*j, Vector(140, -380), Vector(0, 300), + 0, 90-5*j, 140, 380, Vector(0, 300), 1, Color(.6f, .6f, .6f), 5, 1.8f, LAYER_OBJECTS+1)); Sector::current()->add_object(std::make_shared( Vector(get_bbox().p1.x + j*8 + 4, get_bbox().p2.y), - 270+5*j, 360, Vector(140, -380), Vector(0, 300), + 270+5*j, 360, 140, 380, Vector(0, 300), 1, Color(.6f, .6f, .6f), 5, 1.8f, LAYER_OBJECTS+1)); } } @@ -166,11 +166,11 @@ IceCrusher::collision_solid(const CollisionHit& hit) { Sector::current()->add_object(std::make_shared( Vector(get_bbox().p2.x - j*8 - 4, get_bbox().p2.y), - 0, 90+10*j, Vector(140, -260), Vector(0, 300), + 0, 90+10*j, 140, 260, Vector(0, 300), 1, Color(.6f, .6f, .6f), 4, 1.6f, LAYER_OBJECTS+1)); Sector::current()->add_object(std::make_shared( Vector(get_bbox().p1.x + j*8 + 4, get_bbox().p2.y), - 270+10*j, 360, Vector(140, -260), Vector(0, 300), + 270+10*j, 360, 140, 260, Vector(0, 300), 1, Color(.6f, .6f, .6f), 4, 1.6f, LAYER_OBJECTS+1)); } }