you will need to think differently in Corona as you cannot sleep code without it blocking the main thread.
I would suggest you study the tutorials and guides and work through the sample apps.
you will need to think differently in Corona as you cannot sleep code without it blocking the main thread.
I would suggest you study the tutorials and guides and work through the sample apps.
Hey again, sorry but for some reason whenever I add this infinite loop to my main.lua file, corona doesn’t respond.
while true do
if justEnteredViridisTown2 == 1 then
if enteredViridisTown2 == 1 then
player.x = display.contentWidth / 2
player.y = display.contentHeight / 1.5
justEnteredViridisTown2 = 0
end
end
end
that is because it is an infinite loop…
You answered your own question, it’s an infinite loop. It will keep executing until the while condition is not fulfilled, in this case this is never.
Porting my game to Unity, while also contracting as a Unity Developer at a mobile games firm in Brighton.
Maybe I wrote the question wrong. I meant that whenever I add this code to corona, and I then go to start up corona simulator, instead of starting up my app, it is not responding and crashes.
You are blocking the main thread with never-ending code, so your app will appear to not be responding. It never has a chance to update the screen or do anything else, so the os assumes it is not responding.
Ok, thank you, but how can I change this code to work? Thank you everyone so much for your help so far!
Well this looks like code that you want to continually check for a certain set of conditions and then do something when met, so you can put this in an enterFrame listener too.
In the nicest possible way you are trying to run before you can walk… you need to work through the tutorials and guides I linked for you so you understand.
Thank you man, don’t worry haha, I’m not someone who gets offended very often haha. It’s just that my college course is very fast and we are trying to make our own apps at the moment.
It’s working now! Thank you all so much!!
as you’ll probably want to move objects take a look at this as it covers the basics… https://coronalabs.com/blog/2015/08/25/tutorial-animation-with-enterframe-listeners/
Thank you so much man. All of my code works now but there’s just one more question. How do I change the icon for apk’s. It doesn’t matter too much but I just want the app to look great.
Don’t worry, I’ve sorted it out lol. Have a great rest of your day!