I'm trying to move my sprite forward by key pressing but when i want the sprite to move constant forwards by using a while loop Corona crashes everytime.
Using while loop crashes Corona
Mar 10 2019 06:02 AM
Generally, you're not going to use while loops to move objects. Your devices run millions of operations per second and a loop is just going to execute too fast to see anything visual. Also, those loops, if they don't end correctly you can tie up your CPU and with Corona is single threaded, it will appear to lock up your device.
Use timers, enterFrame listeners, transitions, or physics to move objects.
That's my code so how would I used a while loop to see if it would continue the sprite moving in one direction rather than constant pressing, when I press A it moves once.