#include "jumpy.hpp"
+#include "lisp/writer.hpp"
+#include "sprite/sprite.hpp"
+#include "object_factory.hpp"
+#include "object/player.hpp"
+
static const float JUMPSPEED=-600;
static const float JUMPY_MID_TOLERANCE=4;
static const float JUMPY_LOW_TOLERANCE=2;
Jumpy::Jumpy(const lisp::Lisp& reader)
- : BadGuy(reader, "images/creatures/jumpy/jumpy.sprite"), groundhit_pos_set(false)
+ : BadGuy(reader, "images/creatures/snowjumpy/snowjumpy.sprite"), groundhit_pos_set(false)
{
+ // TODO create a nice sound for this...
+ //sound_manager->preload("sounds/skid.wav");
}
void
{
writer.start_list("jumpy");
- 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("jumpy");
}
groundhit_pos_set = true;
}
- physic.set_velocity_y(frozen ? 0 : JUMPSPEED);
+ physic.set_velocity_y((frozen || get_state() == STATE_FALLING) ? 0 : JUMPSPEED);
// TODO create a nice sound for this...
//sound_manager->play("sounds/skid.wav");
} else if(chit.top) {