Closed samreid closed 10 years ago
Stay tuned, I still need to fix a few errors. I'll commit again for this issue.
I think I've got it now. There is still a JSHint warning about using Poolable constructor without the "new" keyword, but I have left it for now since that is the usage in Vector2 as well.
Assigning to @samreid for review
I added /* jshint -W064 */ to work around Poolable linting issue.
Looks like it is working well, nice work. Closing.
I noticed that PhotonBeam is using its own pooling implementation. Would it be possible to rewrite the pooling using PHET_CORE/Poolable so that this logic can be isolated/consolidated? One issue that may come up in the near future is different handling of free/used items, since array push/pop creates garbage itself. If we are all using one implementation of pooling, it could be easier to address issues like that. For an example of how to use Poolable, see DOT/Vector2.