Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Is there, or will there be support for threading?

Author
Message
theUsual
9
Years of Service
User Offline
Joined: 13th Jul 2015
Location: Norway
Posted: 19th Jul 2015 04:18 Edited at: 19th Jul 2015 04:20
Hi!

I find it very hard to get my head around to have to account for every single animation, update, etc in the main loop.

If I want an animation to occure only once at the start of something while other things in the main loop is running, I usually find myself writing a huge if-elseif-statment, that runs the animation if animation = 1, and when the animation is done, i change it to animation = 0, making the if-statment ignore the block at all times.
It's okay when it's as simple as this, but if I'm executing an animation, or updating a real-time timer, and the main loop stalls at a nested loop that has to finish or a short sleep(), neither the clock or animation updates for a few syncs. This also applies to checking if the user touches the screen, or press the "back-button" on a Android device.

Is there something I'm missing that could help me out?

I would much rather do this:


than:


Thanks in advance

Login to post a reply

Server time is: 2024-11-24 12:22:58
Your offset time is: 2024-11-24 12:22:58