0c5e5ef578
For each requested animation frame (RAF) in Phaser, Phaser calls the "update" method, then the "render" method of each scenes. The "render" method takes some time (and energy) to perform the rendering. The fact is we probably don't need to call "render" if nothing changed on the screen (which happens most of the frames in a typical WorkAdventure game). This commit is therefore overloading the "Game" class of Phaser to add a "dirty" flag. Scenes can now add a "isDirty()" method. If all displayed scenes are pristine (not dirty), Phaser will skip rendering the frame altogether. This saves "a lot" of energy, resulting in laptops that are not overheating when using WorkAdventure \o/ |
||
---|---|---|
.. | ||
dist | ||
packages/iframe-api-typings | ||
src | ||
tests/Phaser | ||
.dockerignore | ||
.eslintrc.json | ||
.gitignore | ||
Dockerfile | ||
jasmine.json | ||
LICENSE.txt | ||
package.json | ||
templater.sh | ||
tsconfig.json | ||
webpack.config.js | ||
webpack.prod.js | ||
yarn.lock |