So I’m trying to incorporate alerts into my projects but It always goes into infinite loops since the variable is always true and I have tried so many ways to only alert the user once but it I’ve gotten it to do it 2 times.
Here’s what I did, can someone make it so it only asks once?
alertT=false
alertTimer=0
startTimer=false
end
if Currenttouch.x > blah blah and currenttouch.x < blah blah and so on THEN
alertT=true
startTimer=true
end
if alertT == true then
alert("test","test")
end
if startTimer == true then
alertTimer=alertTimer+1
end
if alertTimer>0.000000001 then
alertT=false
alertTimer=0
That isn’t the exact code since I don’t have my iPad with me but it is basically the same thing summed up.
I had even put:
text(alertTimer,WIDTH/2,HEIGHT/2)
And I noticed that after the timer goes back to zero it keeps going back up to 0.000001 and restarting over and over again.
Please help