Search the Community
Showing results for tags 'render loop'.
Found 2 results
Panuchka posted a topic in Questions & AnswersJust a quick question; how to not freeze the render loop when doing "heavy" operations? Example: In my game, I have a stage that is composed of squares. The player can move around the stage but so can the enemies. The enemies are using a pathfinding system that uses navigation mesh. This navigation mesh is created dynamically when the game runs. Player can destroy the tiles of the stage. The tile destruction triggers the recalculation of the navmesh. The recalculation itself is a pretty heavy operation that freezes the whole game for a second or so. What I'm pretty much asking is if there is an async functionality for heavy functions/operations that are triggered from the render loop. Or what is the best way to handle these situations?
Hi, In all of the examples, pixi animates through the use of requestAnimationFrame (calling requestAnimationFrame again as a callback). However, in this intro video, https://www.youtube.com/watch?v=TYmeAsfTCo0 the host very clearly says that you would not want to do that in a production site, and that you should use some sort of animation loop. I am wondering, does anyone have an example of this sort of loop?