Mr Bomb turns arround again when colliding with other badguys.
[supertux.git] / src / badguy / bomb.cpp
index d7e4caa..c9e2c8a 100644 (file)
 #include "random_generator.hpp"
 #include "object/sprite_particle.hpp"
 
-Bomb::Bomb(const Vector& pos, Direction dir)
-       : BadGuy(pos, "images/creatures/mr_cherry/cherry.sprite")
+Bomb::Bomb(const Vector& pos, Direction dir, std::string custom_sprite /*= "images/creatures/mr_cherry/cherry.sprite"*/ )
+       : BadGuy( pos, dir, custom_sprite )
 {
   state = STATE_TICKING;
-  this->dir = dir;
   set_action(dir == LEFT ? "ticking-left" : "ticking-right", 1);
   countMe = false;
 
@@ -58,13 +57,11 @@ Bomb::write(lisp::Writer& )
   // bombs are only temporarily so don't write them out...
 }
 
-HitResponse
-Bomb::collision_solid(GameObject& , const CollisionHit& hit)
+void
+Bomb::collision_solid(const CollisionHit& hit)
 {
-  if(fabsf(hit.normal.y) > .5)
+  if(hit.bottom)
     physic.set_velocity_y(0);
-
-  return CONTINUE;
 }
 
 HitResponse