// give Feedback
sound_manager->play("sounds/mr_tree.ogg", get_pos());
player.bounce(*this);
-
+
// spawn some particles
// TODO: provide convenience function in MovingSprite or MovingObject?
- for (int i = 0; i < 25; i++) {
- Vector ppos = bbox.get_middle();
+ for (int px = (int)stumpy->get_bbox().p1.x; px < (int)stumpy->get_bbox().p2.x; px+=10) {
+ Vector ppos = Vector(px, stumpy->get_bbox().p1.y-5);
float angle = systemRandom.randf(-M_PI_2, M_PI_2);
float velocity = systemRandom.randf(45, 90);
float vx = sin(angle)*velocity;
leaf1 = leaf1;
Sector::current()->add_object(leaf1);
}
-
+
// spawn PoisonIvy
Vector leaf2_pos = Vector(stumpy_pos.x + sprite->get_current_hitbox_width() + 1, stumpy_pos.y - POISONIVY_Y_OFFSET);
Rect leaf2_bbox = Rect(leaf2_pos.x, leaf2_pos.y, leaf2_pos.x + POISONIVY_WIDTH, leaf2_pos.y + POISONIVY_HEIGHT);
}
IMPLEMENT_FACTORY(MrTree, "mrtree")
-