- // spawn some particles
- // TODO: provide convenience function in MovingSprite or MovingObject?
- for (int i = 0; i < 3; i++) {
- Vector ppos = bbox.get_middle();
- float angle = systemRandom.randf(-M_PI_2, M_PI_2);
- float velocity = systemRandom.randf(350, 400);
- float vx = sin(angle)*velocity;
- float vy = -cos(angle)*velocity;
- Vector pspeed = Vector(vx, vy);
- Vector paccel = Vector(0, 100);
- Sector::current()->add_object(new SpriteParticle("images/objects/particles/poisonivy.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS-1));
- }
- kill_squished(player);
- return true;
-}
-
-void
-PoisonIvy::collision_solid(const CollisionHit& hit)
-{
- if(hit.top || hit.bottom) {
- physic.set_velocity_y(0);
- } else if(hit.left || hit.right) {
- dir = dir == LEFT ? RIGHT : LEFT;
- sprite->set_action(dir == LEFT ? "left" : "right");
- physic.set_velocity_x(-physic.get_velocity_x());
+ // spawn some particles
+ // TODO: provide convenience function in MovingSprite or MovingObject?
+ for (int i = 0; i < 3; i++) {
+ Vector ppos = bbox.get_middle();
+ float angle = systemRandom.randf(-M_PI_2, M_PI_2);
+ float velocity = systemRandom.randf(350, 400);
+ float vx = sin(angle)*velocity;
+ float vy = -cos(angle)*velocity;
+ Vector pspeed = Vector(vx, vy);
+ Vector paccel = Vector(0, 100);
+ Sector::current()->add_object(new SpriteParticle("images/objects/particles/poisonivy.sprite", "default", ppos, ANCHOR_MIDDLE, pspeed, paccel, LAYER_OBJECTS-1));