-// $Id$
-//
// MoleRock - Rock thrown by "Mole" Badguy
// Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
//
-// 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 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 3 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
// 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.
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
-#include <config.h>
+#include "badguy/mole_rock.hpp"
-#include "mole_rock.hpp"
+#include "audio/sound_manager.hpp"
+#include "sprite/sprite.hpp"
+#include "supertux/object_factory.hpp"
-MoleRock::MoleRock(const lisp::Lisp& reader)
- : BadGuy(reader, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2), parent(0), initial_velocity(Vector(0, -400))
+MoleRock::MoleRock(const Reader& reader)
+ : BadGuy(reader, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2), parent(0), initial_velocity(Vector(0, -400))
{
physic.enable_gravity(true);
countMe = false;
- sound_manager->preload("sounds/fall.wav");
+ sound_manager->preload("sounds/darthit.wav");
sound_manager->preload("sounds/stomp.wav");
}
-MoleRock::MoleRock(const Vector& pos, const Vector& velocity, const BadGuy* parent = 0)
- : BadGuy(pos, LEFT, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2), parent(parent), initial_velocity(velocity)
+MoleRock::MoleRock(const Vector& pos, const Vector& velocity, const BadGuy* parent = 0) :
+ BadGuy(pos, LEFT, "images/creatures/mole/mole_rock.sprite", LAYER_TILES - 2),
+ parent(parent),
+ initial_velocity(velocity)
{
physic.enable_gravity(true);
countMe = false;
- sound_manager->preload("sounds/fall.wav");
- sound_manager->preload("sounds/stomp.wav");
-}
-
-MoleRock::MoleRock(const MoleRock& other)
- : BadGuy(other), parent(other.parent), initial_velocity(Vector(0, -400))
-{
- sound_manager->preload("sounds/fall.wav");
+ sound_manager->preload("sounds/darthit.wav");
sound_manager->preload("sounds/stomp.wav");
}
}
void
-MoleRock::write(lisp::Writer& writer)
-{
- writer.start_list("mole_rock");
- writer.write_float("x", start_position.x);
- writer.write_float("y", start_position.y);
- writer.end_list("mole_rock");
-}
-
-void
MoleRock::initialize()
{
physic.set_velocity(initial_velocity);
return BadGuy::collision_player(player, hit);
}
-IMPLEMENT_FACTORY(MoleRock, "mole_rock")
+IMPLEMENT_FACTORY(MoleRock, "mole_rock");
+
+/* EOF */