Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using rectangle or circle as particle causes TypeError due to missing frames property #71

Open
ghost opened this issue Feb 10, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Feb 10, 2018

Returning a basic rectangle or circle from the spriteFunction in makeParticle() will cause an error. The error is also triggered if you don't provide a sprite function and rely on the default which returns g.circle(). It can be fixed by changing the code on line 2314 of plugins.js from:

      if (particle.frames.length > 0) {
        particle.gotoAndStop(randomInt(0, particle.frames.length - 1));
      }

to

      if (particle.frames && particle.frames.length > 0) {
        particle.gotoAndStop(randomInt(0, particle.frames.length - 1));
      }

This makes it possible to try out particle effects using simple built in primitives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants