Sign in to follow this  
Wasyl

Ninja physics - problem with groups (slow motion?)

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?

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.