Hi,
I am trying to send a warning to the player by displaying a text on screen when he is getting close to the edge of the playing field.
The text displays allright, the problem is that when the player is back inside the ‘safe zone’ the text remains on screen. Like if the player gets the warning message and then moves inside (say, indicator.x like 200), the text remains on display for the rest of the game. I want the text on display only when indicator.x is between 245 and 260.
Any help, please?
Here is the code:
if indicator.x\>245 and indicator.x\<260 then local warning1 = display.newText("Carefull, you are close to the edge!", 100, 500, native.systemFont, 40) warning1:setTextColor(255, 0, 0) end