Skip to content

Commit

Permalink
Stalactites break free when disturbed by fire and ice bullets
Browse files Browse the repository at this point in the history
  • Loading branch information
LMH0013 committed Sep 6, 2013
1 parent a84a337 commit 450b140
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/badguy/stalactite.cpp
Expand Up @@ -17,6 +17,7 @@
#include "badguy/stalactite.hpp"

#include "math/random_generator.hpp"
#include "object/bullet.hpp"
#include "object/player.hpp"
#include "sprite/sprite.hpp"
#include "supertux/object_factory.hpp"
Expand Down Expand Up @@ -114,6 +115,18 @@ Stalactite::collision_badguy(BadGuy& other, const CollisionHit& hit)
return FORCE_MOVE;
}

HitResponse
Stalactite::collision_bullet(Bullet& bullet, const CollisionHit& )
{
if(state == STALACTITE_HANGING) {
timer.start(SHAKE_TIME);
state = STALACTITE_SHAKING;
bullet.remove_me();
}

return FORCE_MOVE;
}

void
Stalactite::kill_fall()
{
Expand Down
1 change: 1 addition & 0 deletions src/badguy/stalactite.hpp
Expand Up @@ -28,6 +28,7 @@ class Stalactite : public BadGuy
void collision_solid(const CollisionHit& hit);
HitResponse collision_player(Player& player, const CollisionHit& hit);
HitResponse collision_badguy(BadGuy& other, const CollisionHit& hit);
HitResponse collision_bullet(Bullet& bullet, const CollisionHit& );

void kill_fall();
void draw(DrawingContext& context);
Expand Down

0 comments on commit 450b140

Please sign in to comment.