replit / kaboom

💥 JavaScript game library
https://kaboomjs.com
MIT License
2.61k stars 226 forks source link

Make Opacity required component for Lifespan. #826

Open tejaboy opened 4 months ago

tejaboy commented 4 months ago

There was no indication that the lifespan component requires the opacity component. I spent quite sometime debugging it for my own game. It was when I used the fadeIn component, then the error state that the opacity component was required. So I thought it'd be nice that lifespan component gives an error like fadeIn.

When the error does not prevent the script from continuing, I added a shorthand code to set the opacity to 1 if it's not set, else the current opacity.