#include <config.h>
#include "mrtree.hpp"
+
#include "stumpy.hpp"
#include "poisonivy.hpp"
#include "random_generator.hpp"
#include "object/sprite_particle.hpp"
#include "sector.hpp"
+#include "lisp/writer.hpp"
+#include "object_factory.hpp"
+#include "audio/sound_manager.hpp"
+
+#include <math.h>
static const float WALKSPEED = 100;
: WalkingBadguy(reader, "images/creatures/mr_tree/mr_tree.sprite","left","right")
{
walk_speed = WALKSPEED;
- max_drop_height = 0;
+ max_drop_height = 16;
sound_manager->preload("sounds/mr_tree.ogg");
}
}
bool
-MrTree::collision_squished(Player& player)
+MrTree::collision_squished(GameObject& object)
{
// replace with Stumpy
Vector stumpy_pos = get_pos();
// give Feedback
sound_manager->play("sounds/mr_tree.ogg", get_pos());
- player.bounce(*this);
+ Player* player = dynamic_cast<Player*>(&object);
+ if (player) player->bounce(*this);
// spawn some particles
// TODO: provide convenience function in MovingSprite or MovingObject?