#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;
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)
{
*/
virtual bool collision_squished(Player& player);
+ /** Called when the badguy collided with a bullet */
+ virtual HitResponse collision_bullet(Bullet& bullet,
+ const CollisionHit& hit);
+
/** called each frame when the badguy is activated. */
virtual void active_update(float elapsed_time);
/** called each frame when the badguy is not activated. */