Hello all,
I need some suggestions/advice on how to proceed. At the moment I have everything working but cant figure out on how I should approach the final step. I would like to display text on screen and play a sound, but only based on 3 images’ x/y coordinates and after the other sounds have played.
I have included a trimmed version of the code so far, keep in mind that I have 2 other test targets.
Also, I have added obj2.isMovable = false, but I can still move the object. What else do I need to do?
Thanks!
[code] --Test Target3 > Boy3
–For some reason the check has to be done in reverse for this boy, i don’t get it
elseif obj1.myName == “target” and obj2.myName == “boy3” then
transition.to(obj2, {x=400, y=250})
audio.play(lastsound)
obj2.isMovable = false --Set the boy to unmoveable
elseif obj1.myName == “target2” and obj2.myName == “boy3” then
transition.to(obj2, {x=400, y=50})
elseif obj1.myName == “boy3” and obj2.myName == “target3” then
transition.to(obj1, {x=400, y=50})
–final
local youdiditText = display.newText(“You did it!”, 0, 0, “HelveticaNeue”, 42)
youdiditText:setTextColor(255, 255, 255)
youdiditText.x = display.contentCenterX
youdiditText.y = displaycontentCenterY
transition.to(youdiditText, {x=240, y=150})
localGroup:insert(youdiditText) [import]uid: 32253 topic_id: 8519 reply_id: 308519[/import]