#include "supertux/object_factory.hpp"
static const float JUMPSPEED = -450;
-static const float WALKSPEED = 80;
+static const float BSNOWBALL_WALKSPEED = 80;
BouncingSnowball::BouncingSnowball(const Reader& reader)
: BadGuy(reader, "images/creatures/bouncing_snowball/bouncing_snowball.sprite")
void
BouncingSnowball::initialize()
{
- physic.set_velocity_x(dir == LEFT ? -WALKSPEED : WALKSPEED);
+ physic.set_velocity_x(dir == LEFT ? -BSNOWBALL_WALKSPEED : BSNOWBALL_WALKSPEED);
sprite->set_action(dir == LEFT ? "left" : "right");
}
void
BouncingSnowball::collision_solid(const CollisionHit& hit)
{
+ if(sprite->get_action() == "squished")
+ {
+ return;
+ }
+
if(hit.bottom) {
if(get_state() == STATE_ACTIVE) {
physic.set_velocity_y(JUMPSPEED);
return CONTINUE;
}
-IMPLEMENT_FACTORY(BouncingSnowball, "bouncingsnowball");
-
/* EOF */