you may use the following code
[lua]local background = display.newImage(“background.png”)
local circle1,circle2,circle3
function flagSquare(_e)
if _e.phase == “ended” then
print(“hit square”)
end
end
function dispatchSquare()
if circle1.touched == true and circle2.touched == true and circle3.touched == true then
local square = display.newRect(150,300, 60,60)
local planet = display.newImage(“planet.png”)
planet.x = 100; planet.y = 250
square:addEventListener(“touch”, flagSquare)
end
end
function flagCircle(_e)
if _e.phase == “ended” then
_e.target.touched = true
dispatchSquare()
end
end
local function createYC()
circle1 = display.newImage(“yc.png”)
circle1.x = 50; circle1.y = 250
circle1:addEventListener(“touch”, flagCircle)
end
local function createGC()
circle2 = display.newImage(“gc.png”)
circle2.x = 150; circle2.y = 250
circle2:addEventListener(“touch”, flagCircle)
end
local function createRC()
circle3 = display.newImage(“rc.png”)
circle3.x = 100; circle3.y = 250
circle3:addEventListener(“touch”, flagCircle)
end
timer.performWithDelay(1500, createYC ,1)
timer.performWithDelay(2500, createGC ,1)
timer.performWithDelay(3500, createRC ,1)[/lua]
[import]uid: 71210 topic_id: 13785 reply_id: 50807[/import]