ecsyjs / ecsy

Entity Component System for javascript
https://ecsyjs.github.io/ecsy/
MIT License
1.11k stars 115 forks source link

creating a new Entity copies over any values from Custom Entity class #255

Open cfortuner opened 4 years ago

cfortuner commented 4 years ago

hey! Just wanted to post this in case anyone else came across it.

When you extend the entity class _Entity, you need to make sure to reset any custom properties you assign on the entity or else they will be copied over to any new entities that get created!

I think it would be nice to have createEntity call a reset method or avoid copying over these properites.