*possible* fix for bugs #453 and #373
[supertux.git] / src / badguy / mole_rock.cpp
index 5de7914..fb0135e 100644 (file)
 #include "mole_rock.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))
+        : 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/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)
+        : 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))
+        : BadGuy(other), parent(other.parent), initial_velocity(Vector(0, -400))
 {
+  sound_manager->preload("sounds/fall.wav");
+  sound_manager->preload("sounds/stomp.wav");
 }
 
 MoleRock::~MoleRock()
@@ -59,8 +65,8 @@ 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.write("x", start_position.x);
+  writer.write("y", start_position.y);
   writer.end_list("mole_rock");
 }