Hi all, I'm pretty new here and also more of an artist than a coder.
I'm currently prototyping my first game and I have an endless game loop where I switch the background (cross fading) based on certain rules. How would you do it?
Firstly I wouldn't do an endless loop, because it would block all UI and app would be unresponsive. Unless this is your purpose, you can try using timers, which won't block anything.
--running timer 10 times each second should be sufficientlocal timer = Timer.new(100)
timer:addEventListener(Event.TIMER, function()--do what you need to do in loop hereend)--start the timer
timer:start()
Comments
I figured it out thanks to the fading star example
Now on to the next challenge (game logic!)