function prepareSpeechBubbles()
	local speechBubbles={}
	--one for each player
	
	speechBubbles["bottom"]={}
	speechBubbles["bottom"]["timer"]=Timer.new(0)
	speechBubbles["bottom"]["timer"]:reset()
	speechBubbles["bottom"]["text"]="nothing"
	
	speechBubbles["left"]={}
	speechBubbles["left"]["timer"]=Timer.new(0)
	speechBubbles["left"]["timer"]:reset()
	speechBubbles["left"]["text"]="nothing"
	
	speechBubbles["right"]={}
	speechBubbles["right"]["timer"]=Timer.new(0)
	speechBubbles["right"]["timer"]:reset()
	speechBubbles["right"]["text"]="nothing"
	
	speechBubbles["top"]={}
	speechBubbles["top"]["timer"]=Timer.new(0)
	speechBubbles["top"]["timer"]:reset()
	speechBubbles["top"]["text"]="nothing"
	
	return speechBubbles

end


function speechBubbleIsVisible(position)
	local time=speechBubbles[position]["timer"]:time()
	if time>0 and time<=USERPREF["speechBubblesTime"] then
		return true
	elseif time>0 then
		speechBubbles[position]["timer"]:reset()
	end
	return false
end

function setSpeechBubbleText(position, text)
	speechBubbles[position]["text"]=text
end

function startSpeechBubble(position)
	speechBubbles[position]["timer"]:reset() --put the counter to 0
	speechBubbles[position]["timer"]:start()
end

function say(position, text)
	if text~=nil then
		setSpeechBubbleText(position, text)
		startSpeechBubble(position)
	end
end







