Learn how to use Object Pools with Matter.js Physics bodies in Phaser 3.
Tommy Leung from Ourcade concludes his pools tutorial series by covering how to pool Matter physics bodies: "Maintaining a good framerate is important for games where players are expected to react in realtime.
Creating new objects and allocating memory inside update loops is a common cause of framerate drops.
The severity depends on how complex the object is to create and how many times it is created in a single frame.
In this article, we will look at using Object Pools for Phaser 3 GameObjects with Matterjs physics enabled because your complex objects are likely also using physics.
We will be building on the example from Game Optimization with Object Pools in Phaser 3."
Learn to code and lead your intrepid crew on a mission to save The Cloud in TwilioQuest, a PC role-playing game inspired by classics of the 16-bit era. Free forever, and available now for Windows, Mac, and Linux.
The first book on the creation of HTML5 cross platform games using Phaser 3 and other free software.
- By Emanuele Feronato
- 155 Pages
- 28 Source Code Examples
- Build a complete game from start to finish
- Cross Platform
- Scaling for devices