rezoner / playground

Playground.js is a framework for your javascript based games. It gives you out-of-box access to essentials like mouse, keyboard, sound and well designed architecture that you can expand to your needs.
MIT License
459 stars 50 forks source link

Ensure that layer exists #41

Closed frondeus closed 7 years ago

frondeus commented 7 years ago

We check if layer is available after using it. So I moved layer.useAlpha after checking if layer is null or undefined.

It caused sometimes:

TypeError: Cannot set property 'useAlpha' of undefined

For example when another script messed with document or canvas height.