#include "game_session.hpp"
#include "log.hpp"
#include "level.hpp"
+#include "object/bullet.hpp"
static const float SQUISH_TIME = 2;
static const float X_OFFSCREEN_DISTANCE = 1600;
set_group(COLGROUP_DISABLED);
}
+BadGuy::BadGuy(const BadGuy& other)
+ : MovingObject(other), Serializable(other), countMe(other.countMe), physic(other.physic), activated(other.activated), start_position(other.start_position), dir(other.dir), layer(other.layer), state(other.state), state_timer(other.state_timer)
+{
+ sprite = new Sprite(*other.sprite);
+}
+
BadGuy::~BadGuy()
{
delete sprite;
if(player)
return collision_player(*player, hit);
+ Bullet* bullet = dynamic_cast<Bullet*> (&other);
+ if(bullet)
+ return collision_bullet(*bullet, hit);
+
return FORCE_MOVE;
}
case STATE_SQUISHED:
return false;
}
+HitResponse
+BadGuy::collision_bullet(Bullet& , const CollisionHit& )
+{
+ kill_fall();
+ return ABORT_MOVE;
+}
+
void
BadGuy::kill_squished(Player& player)
{