// 02111-1307, USA.
#include <config.h>
-#include "jumpy.h"
+#include "jumpy.hpp"
static const float JUMPSPEED=600;
static const float JUMPY_MID_TOLERANCE=4;
physic.set_velocity_y(JUMPSPEED);
// TODO create a nice sound for this...
- //sound_manager->play_sound("skid");
+ //sound_manager->play("sounds/skid.ogg");
} else if(chit.normal.y < .5) { // bumped on roof
physic.set_velocity_y(0);
}
}
void
-Jumpy::active_action(float elapsed_time)
+Jumpy::active_update(float elapsed_time)
{
- BadGuy::active_action(elapsed_time);
+ BadGuy::active_update(elapsed_time);
dir = Sector::current()->player->get_pos().x > get_pos().x
? RIGHT : LEFT;
+
+ if (!groundhit_pos_set)
+ {
+ sprite->set_action(dir == LEFT ? "left-middle" : "right-middle");
+ return;
+ }
if ( get_pos().y < (pos_groundhit.y - JUMPY_MID_TOLERANCE ) )
sprite->set_action(dir == LEFT ? "left-up" : "right-up");