function BombThingy_use( player )
	SetObjDead( player.item_sprite )
	player.item_sprite = nil
	player.item = nil
	local value
	for i=1,#bullets do
		value = bullets[i]
		if value.friendly == 0 then
			delete(bullets, i)
		end
	end
	for i=1,#enemies do
		value = enemies[i]
		if not value.unbombable and not value.immortal and not value.boss then
			delete(enemies, i)
		end
	end
	Resume( NewThread( function()
		local widget = CreateWidget(constants.wt_Widget, "fade_box", nil, 0, 0, CONFIG.scr_width, CONFIG.scr_height)
		WidgetSetZ(widget, 1)
		WidgetSetVisible(widget, true)
		WidgetSetColorBox(widget, {1, 1, 1, 1} )
		PlaySnd("bomb.wav", false)
		Wait(100)
		DestroyWidget( widget )
	end ))
end

function BombThingy_get( pl )
	PlaySnd( "item.wav", false )
	if players[pl].item_sprite then
		SetObjDead( players[pl].item_sprite )
	end
	players[pl].item = BombThingy_use
	players[pl].item_sprite = CreateSprite( "sprite", players[pl].x, players[pl].y )
	players[pl].item_sprite_pos = { players[pl].x, players[pl].y }
	players[pl].item_sprite_target = { -5, 32 }
	SetObjAnim( players[pl].item_sprite, 20, false )
	SetObjSpriteColor( players[pl].item_sprite, {1, 1, 1, 0.5} )
end

function CreateBombThingy( x, y )
	local spr = CreateSprite( "sprite", x, y )
	SetObjAnim( spr, 20, false )
	table.insert( items, {
		sprite = spr,
		get = BombThingy_get,
		x = x,
		y = y,
		speed = 1,
		size = 16
	} )
end