X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fobject%2Ficecrusher.cpp;h=1e94d656e23b924b50384760a9a545ea9234a353;hb=b09b702acea75965b0192474b813b40195d4d8de;hp=d2fcf5c80a3f1d77b312689ff1b944f9805b1f69;hpb=75fc1b8f0bd2cc8ba9f448678d46db1e882b40a9;p=supertux.git diff --git a/src/object/icecrusher.cpp b/src/object/icecrusher.cpp index d2fcf5c80..1e94d656e 100644 --- a/src/object/icecrusher.cpp +++ b/src/object/icecrusher.cpp @@ -147,14 +147,14 @@ IceCrusher::collision_solid(const CollisionHit& hit) // throw some particles, bigger and more for large icecrusher for(int j = 0; j < 9; j++) { - Sector::current()->add_object( - new Particles(Vector(get_bbox().p2.x - j*8 - 4, get_bbox().p2.y), - 0, 90-5*j, Vector(140, -380), Vector(0, 300), - 1, Color(.6f, .6f, .6f), 5, 1.8f, LAYER_OBJECTS+1)); - Sector::current()->add_object( - new Particles(Vector(get_bbox().p1.x + j*8 + 4, get_bbox().p2.y), - 270+5*j, 360, Vector(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().p2.x - j*8 - 4, get_bbox().p2.y), + 0, 90-5*j, Vector(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), + 1, Color(.6f, .6f, .6f), 5, 1.8f, LAYER_OBJECTS+1)); } } else { @@ -164,14 +164,14 @@ IceCrusher::collision_solid(const CollisionHit& hit) // throw some particles for(int j = 0; j < 5; j++) { - Sector::current()->add_object( - new Particles(Vector(get_bbox().p2.x - j*8 - 4, get_bbox().p2.y), - 0, 90+10*j, Vector(140, -260), Vector(0, 300), - 1, Color(.6f, .6f, .6f), 4, 1.6f, LAYER_OBJECTS+1)); - Sector::current()->add_object( - new Particles(Vector(get_bbox().p1.x + j*8 + 4, get_bbox().p2.y), - 270+10*j, 360, Vector(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().p2.x - j*8 - 4, get_bbox().p2.y), + 0, 90+10*j, Vector(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), + 1, Color(.6f, .6f, .6f), 4, 1.6f, LAYER_OBJECTS+1)); } } set_state(RECOVERING); @@ -238,14 +238,14 @@ IceCrusher::draw(DrawingContext& context) { context.push_target(); context.set_target(DrawingContext::NORMAL); - sprite->draw(context, get_pos(), layer); + sprite->draw(context, get_pos(), layer+2); if(!(state == CRUSHING) && sprite->has_action("whites")) { // draw icecrusher's eyes slightly behind - lefteye->draw(context, get_pos()+eye_position(false), layer-1); - righteye->draw(context, get_pos()+eye_position(true), layer-1); + lefteye->draw(context, get_pos()+eye_position(false), layer+1); + righteye->draw(context, get_pos()+eye_position(true), layer+1); // draw the whites of icecrusher's eyes even further behind - whites->draw(context, get_pos(), layer-2); + whites->draw(context, get_pos(), layer); } context.pop_target(); }