function WeaponThingy_getGreen( pl )
	PlaySnd( "item.wav", false )
	players[pl].weapon_level[1] = players[pl].weapon_level[1] + 1
end

function WeaponThingy_getRed( pl )
	PlaySnd( "item.wav", false )
	players[pl].weapon_level[2] = players[pl].weapon_level[2] + 1
end

function WeaponThingy_getBlue( pl )
	PlaySnd( "item.wav", false )
	players[pl].weapon_level[3] = players[pl].weapon_level[3] + 1
end

WeaponThingy_red = WeaponThingy_getRed
WeaponThingy_green = WeaponThingy_getGreen
WeaponThingy_blue = WeaponThingy_getBlue

function CreateWeaponThingy( x, y, color )
	local spr = CreateSprite( "sprite", x, y )
	SetObjAnim( spr, 7, false )
	if color == WeaponThingy_red then
		SetObjSpriteColor( spr, {1, 0, 0, 1}, 0 )
	elseif color == WeaponThingy_blue then
		SetObjSpriteColor( spr, {0, 0, 1, 1}, 0 )
	end
	table.insert( items, {
		sprite = spr,
		get = color or WeaponThingy_green,
		x = x,
		y = y,
		speed = 1,
		size = 16
	} )
end