ISOmetric

Sprites Colliding with Corners Causes Deceleration and Direction Change

Recommended Posts

I have an issue where I've got a row of rectangular sprites, drawn with phaser graphics, sitting in a seamless row. I then have some circle sprites set to move with set velocity in any of four directions (200x200, 200x-200, -200x200 or -200x-200) and bounce off this row of rectangular sprites. However, and this is behavior I've noticed before in a similar situation, whenever a circle sprite hits a rectangular one directly on the corner, the velocity drops drastically and it's direction changes substantially.

Any clue on why this particular behavior occurs and any steps I can take in fixing it?

Share this post


Link to post
Share on other sites

I shall look into that but I think it's unlikely, as I can see this behavior when I have a single rectangle on it's own. I'll put together a sandbox to try and replicate it.

 

EDIT: here's a sandbox: https://phaser.io/sandbox/PStxrwRb/play

There's some oddness occurring when the circles hit the side of the purple square (they should bounce off, but they vanish) which isn't happening on my local version but I think the issue I'm having is quite clearly replicated. Also, sorry my code is a mess, I'm currently refactoring and I've been doing some chopping and changing.

Edited by ISOmetric
Added Sandbox Link

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...

  • Recently Browsing   0 members

    No registered users viewing this page.