Hello, I’m trying to display “Speed up!” on screen when the score==50. I also have a touch listener attached to my background to move my character left and right.
Here is my code I’m using to show the text:
function speedup() speedup= display.newText( "SPEED UP!", centerX, centerY, "Capture\_it", 46 ) sceneGroup:insert(speedup) speedup.xScale=5 speedup.yScale=5 speedup:setFillColor (0.96, 0.78, 0 ) transition.to ( speedup, {time=200,xScale=1,yScale=1} ) transition.to ( speedup, {delay=200,time=3000,y=screenTop} ) transition.to ( speedup, {delay=250,time= 800,alpha=0} ) print("TRANSITION COMPLETED") end if score ==50 then if d1==1 then speedup() audio.play(speedSound) end d1=d1+1 end
I have this in scene:create section. It shows up on screen as expected and does the transition it is supposed to but if during the transition I tap on my background to move my character it halts the transition wherever it is and stays their until the game ends.
I have tried to put this code in different portions of the scene but same thing happens
Please help!