X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fbadguy%2Fmrbomb.cpp;h=a5290489857d1824e09cd0ad7e756b46f68f2d98;hb=8d1566374788e2c612b35d6b95463398a555b54a;hp=563cd6fdc4e95c705a879c97b3a29815e5882a4f;hpb=62ff7f7776875e9389d10ae2e7b6348e9e5cb9c7;p=supertux.git diff --git a/src/badguy/mrbomb.cpp b/src/badguy/mrbomb.cpp index 563cd6fdc..a52904898 100644 --- a/src/badguy/mrbomb.cpp +++ b/src/badguy/mrbomb.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 "mrbomb.h" @@ -29,8 +49,8 @@ MrBomb::write(lisp::Writer& writer) { writer.start_list("mrbomb"); - writer.write_float("x", get_pos().x); - writer.write_float("y", get_pos().y); + writer.write_float("x", start_position.x); + writer.write_float("y", start_position.y); writer.end_list("mrbomb"); } @@ -77,3 +97,14 @@ MrBomb::collision_badguy(BadGuy& , const CollisionHit& hit) return CONTINUE; } + +void +MrBomb::kill_fall() +{ + remove_me(); + Bomb* bomb = new Bomb(get_pos(), dir); + Sector::current()->add_object(bomb); + bomb->explode(); +} + +IMPLEMENT_FACTORY(MrBomb, "mrbomb")