craftyjs / Crafty

JavaScript Game Engine
http://craftyjs.com
MIT License
3.38k stars 561 forks source link

Add a promise-driven initAsync method #1191

Closed starwed closed 5 years ago

starwed commented 5 years ago

This allows the loading of resources (such as web assembly modules, which were the main motivation) before initializing Crafty. Specifically, it supports a pattern where async loaders might want to modify Crafty directly.

It also builds in support for waiting for the document to load.