function Energy_get( pl )
	PlaySnd( "energy.wav", false )
	players[pl].score = players[pl].score + 10
	if players[pl].energy < 32 then
		local ang = time / 1000 + players[pl].energy * math.pi / 32
		local x, y = players[pl].x + 32*math.cos(ang), players[pl].y + 32*math.sin(ang)
		local spr = CreateSprite( "sprite2", x, y )
		local tab = { x = x, y = y, sprite = spr }
		SetObjAnim( spr, 4, false )
		CreateLightSource( tab, {20/255, 124/255, 158/255, -0.25}, 8 )
		table.insert( players[pl].energy_visuals, tab )
		players[pl].energy = players[pl].energy+1
	end
end

WeaponThingy_red = WeaponThingy_getRed
WeaponThingy_green = WeaponThingy_getGreen
WeaponThingy_blue = WeaponThingy_getBlue

function CreateEnergy( x, y )
	local spr = CreateSprite( "sprite2", x, y )
	SetObjAnim( spr, 3, false )
	table.insert( items, {
		sprite = spr,
		get = Energy_get,
		x = x,
		y = y,
		speed = 1,
		size = 16
	} )
end