HELP ME!

The text not appears, hel me, where is the error???

 code:
 

local W = display.contentWidth / 2
local H = display.contentHeight / 2

–schermata 1
local schermataMenuGroup
local play
– schermata 2

local circle
local circle1
local text

function main()
menuPrincipale() 
end

function  menuPrincipale()
schermataMenuGroup = display.newGroup()

play = display.newText(“Play!”, 0, 0, “Arial”, 30)
play.x = W
play.y = H
play:setTextColor(255,255,255)
play.name = “play”

play:addEventListener(“tap”, loadGame)

schermataMenuGroup:insert(play)

end

function loadGame(event)
if event.target.name == “play” then
 
  – Transizione e rimozione del Listener
    
  transition.to(schermataMenuGroup,{time = 0, alpha=0, onComplete = addGameScreen})
  
  play:removeEventListener(“tap”, loadGame)
end
end

 
local function dragMe(event)
local t=event.target
if event.phase==“moved” then
t.x=event.x
t.y=event.y
end
end

function addGameScreen()

circle = display.newCircle(W, H-200, 30)
circle:setFillColor(2,227,112)

circle1 = display.newCircle(W, H+200, 50)
circle1:setFillColor(0, 0, 0, 0)
circle1.strokeWidth =3

text = display.newText("", 0, 0, “Arial”, 30)
text.x = W
text.y = H

circle:addEventListener( “touch”, dragMe)

end

local function hasCollidedCircle( circle, circle1 )
   if ( circle == nil ) then  --make sure the first object exists
      return false
   end
   if ( circle == nil ) then  --make sure the other object exists
      return false
   end

   local dx = circle.x - circle1.x
   local dy = circle.y - circle1.y

   local distance = math.sqrt( dx*dx + dy*dy )
   local objectSize = (circle1.contentWidth/2) + (circle.contentWidth/2)

   if ( distance < objectSize ) then
      return true
   end
   return false
  
 
 

end

if hasCollidedCircle then
text = “you win”
end

main()

Have you looked at the console output to see if there are any error messages?  Read this blog post for debugging advice: http://www.coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/.

Also, in the future, please follow these guidelines about using the Corona forums: http://www.coronalabs.com/blog/2013/04/02/corona-forum-rules-and-guidelines/.  In particular, please use a descriptive subject line (guideline #4) and don’t shout (guideline #11).

Last, you should enclose your code in lua tags so that it’s more readable in the forums.  Click the Post Formatting Tips button to see how to do that.

Thanks.

  • Andrew

This seems to be a duplicate post to this thread:

http://forums.coronalabs.com/topic/38175-i-need-help/

Please only create one forum post.  Everyone, please respond on the other post please.

Have you looked at the console output to see if there are any error messages?  Read this blog post for debugging advice: http://www.coronalabs.com/blog/2013/07/09/tutorial-basic-debugging/.

Also, in the future, please follow these guidelines about using the Corona forums: http://www.coronalabs.com/blog/2013/04/02/corona-forum-rules-and-guidelines/.  In particular, please use a descriptive subject line (guideline #4) and don’t shout (guideline #11).

Last, you should enclose your code in lua tags so that it’s more readable in the forums.  Click the Post Formatting Tips button to see how to do that.

Thanks.

  • Andrew

This seems to be a duplicate post to this thread:

http://forums.coronalabs.com/topic/38175-i-need-help/

Please only create one forum post.  Everyone, please respond on the other post please.