- if (sprite->get_name() == "egg") {
- player->set_bonus(GROWUP_BONUS, true);
- sound_manager->play("sounds/grow.ogg");
- } else if (sprite->get_name() == "fireflower") {
- player->set_bonus(FIRE_BONUS, true);
- sound_manager->play("sounds/fire-flower.ogg");
- } else if (sprite->get_name() == "star") {
+ if (sprite_name == "images/powerups/egg/egg.sprite") {
+ if(!player->add_bonus(GROWUP_BONUS, true))
+ return FORCE_MOVE;
+ sound_manager->play("sounds/grow.wav");
+ } else if (sprite_name == "images/powerups/fireflower/fireflower.sprite") {
+ if(!player->add_bonus(FIRE_BONUS, true))
+ return FORCE_MOVE;
+ sound_manager->play("sounds/fire-flower.wav");
+ } else if (sprite_name == "images/powerups/star/star.sprite") {