Skip to content

scrmea/pixijs-sprite-sheets

 
 

Repository files navigation

How to optimize your PixiJS game for fast loading

This small demo app shows how you can use sprite sheets to optimize the loading time of your PixiJS game.

Please visit our full tutorial How to create sprite sheets and animations with PixiJS.

Loading times measured on a local network, simulated with Chrome: Fast 3G network.

Loading single sprites (a bad idea!) ~ 14.5s

The first demo loads all sprites as single images. You see that Chrome makes 68 requests with a total of 1.6MB. The scene is ready after 14.5s.

Single sprite demo

Loading single sprites is a bad idea

Loading sprites from a sprite sheet (good) ~ 12.5s

This demo uses a single sprite sheet containing all assets. The demo uses a 32 bit png file for full quality.

The scene is loaded after 11s, in 7 requests with a total of 1.6MB loaded from the server.

Sprite sheet demo

Loading single sprites is a bad idea

Loading sprites from an optimized sprite sheet (best): ~ 8s

This demo uses the sprite sheet from above, this time reduced to png-8. The loading time is below 7s. The number of requests is 7 with 834Kb loaded from the server.

Optimized sprite sheet demo

Loading single sprites is a bad idea

About

How to use sprite sheets with PixiJS and optimize your game for faster startup.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PLSQL 80.5%
  • JavaScript 11.1%
  • HTML 8.4%