- if (kind == UPGRADE_GROWUP)
- img_growup->draw_part(0,0,dest.x,dest.y,dest.w,dest.h);
- else if (kind == UPGRADE_ICEFLOWER)
- img_iceflower->draw_part(0,0,dest.x,dest.y,dest.w,dest.h);
- else if (kind == UPGRADE_HERRING)
- img_golden_herring->draw_part(0,0,dest.x,dest.y,dest.w,dest.h);
- else if (kind == UPGRADE_1UP)
- img_1up->draw_part( 0, 0, dest.x, dest.y, dest.w, dest.h);
- }
+void
+Upgrade::bump(Player* player)
+{
+ // these can't be bumped
+ if(kind != UPGRADE_GROWUP)
+ return;
+
+ SoundManager::get()->play_sound(IDToSound(SND_BUMP_UPGRADE), Vector(base.x, base.y), Sector::current()->player->get_pos());
+
+ // determine new direction
+ Direction old_dir = dir;
+ if (player->base.x + player->base.width/2 > base.x + base.width/2)
+ dir = LEFT;