liabru / matter-attractors

an attractors plugin for matter.js
MIT License
148 stars 31 forks source link

Apply force to bodies added before attractor #5

Open jpagand opened 7 years ago

jpagand commented 7 years ago

When you add bodies before the attractor, they will have no force applied. You were applying force only to bodies of index attractor + 1

jpagand commented 7 years ago

hey @liabru did you have time to review this?

francoispeyret commented 3 years ago

When you add bodies before the attractor, they will have no force applied. You were applying force only to bodies of index attractor + 1

Hi, your modification on one of my test (with the "for" modified and the condition added) gives no change. Is it still working for you?

EDIT : It works well, my test was not effective! 👍

bits-by-brandon commented 2 years ago

@liabru I think this change would unblock a project i'm working on. Any chance this could be merged in?