Jump to content

Ninja physics - problem with groups (slow motion?)


Wasyl
 Share

Recommended Posts

Hi, I have a problem with Ninja physics when I adding a group with sprite in my game.

I read on this forum, that Ninja doesn't support group collision, but mayby something was changed withing the last year, because in my it work, but not that what I expected.

http://codepen.io/DonWasyl/pen/BjEeBL

What could be the cause this "bullet time" effect?
Without group everything was ok.

Can I use any trick for repair that?

Link to comment
Share on other sites

I did this with your code:

http://codepen.io/anon/pen/gPJpKm

And got rid of the bullet time.  I basically still use the groups for grouping things, but enabled the physics bodies and collisions manually, by looping through the group's children array.

The thing causing the bullet time is colliding a box with itself.  Remove the line:

if(i == j) continue;

In my code to see it happen.

When you collide the group against itself, it doesn't do that check, so you get the slowdown.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...