X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fdispenser.cpp;h=b72daae82849438817f8cc74d4ffe0da62604199;hb=609794e5b7fb466ca1a53d7a2406e2a8ed547de8;hp=9bd2cc03f635601d50ec6ebf8640522f7fc01a7c;hpb=b6a1226fba1a80b0cf21467f318ec02f9d388c13;p=supertux.git diff --git a/src/badguy/dispenser.cpp b/src/badguy/dispenser.cpp index 9bd2cc03f..b72daae82 100644 --- a/src/badguy/dispenser.cpp +++ b/src/badguy/dispenser.cpp @@ -1,3 +1,23 @@ +// $Id$ +// +// SuperTux +// Copyright (C) 2005 Matthias Braun +// +// 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 the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA. + #include #include "dispenser.h" @@ -16,7 +36,10 @@ Dispenser::Dispenser(const lisp::Lisp& reader) reader.get("badguy", badguy); bbox.set_size(32, 32); sprite = sprite_manager->create("dispenser"); - sprite->set_action("working"); + if (badguy == "mrrocket") { + sprite->set_action(dir == LEFT ? "working-left" : "working-right"); + } + else {sprite->set_action("dropper");} } void @@ -43,7 +66,7 @@ bool Dispenser::collision_squished(Player& player) { //TODO: Should it act like a normal tile when killed? - sprite->set_action("broken"); + sprite->set_action(dir == LEFT ? "broken-left" : "broken-right"); dispense_timer.start(0); player.bounce(*this); kill_squished(player); @@ -74,8 +97,8 @@ Dispenser::launch_badguy() Sector::current()->add_object(new MrBomb(get_pos().x, get_pos().y+32, dir)); else if (badguy == "mriceblock") Sector::current()->add_object(new MrIceBlock(get_pos().x, get_pos().y+32, dir)); - else if (badguy == "mrrocket") - Sector::current()->add_object(new MrRocket(get_pos().x, get_pos().y+32, dir)); + else if (badguy == "mrrocket") { + Sector::current()->add_object(new MrRocket(get_pos().x+(dir == LEFT ? -32 : 32), get_pos().y, dir));} else if (badguy == "poisonivy") Sector::current()->add_object(new PoisonIvy(get_pos().x, get_pos().y+32, dir)); else if (badguy == "random") @@ -86,8 +109,7 @@ Dispenser::launch_badguy() case 1: Sector::current()->add_object(new BouncingSnowball(get_pos().x, get_pos().y+32, dir)); break; case 2: Sector::current()->add_object(new MrBomb(get_pos().x, get_pos().y+32, dir)); break; case 3: Sector::current()->add_object(new MrIceBlock(get_pos().x, get_pos().y+32, dir)); break; - case 4: Sector::current()->add_object(new MrRocket(get_pos().x, get_pos().y+32, dir)); break; - case 5: Sector::current()->add_object(new PoisonIvy(get_pos().x, get_pos().y+32, dir)); break; + case 4: Sector::current()->add_object(new PoisonIvy(get_pos().x, get_pos().y+32, dir)); break; } } }