Jump to content

Sprites Colliding with Corners Causes Deceleration and Direction Change


ISOmetric
 Share

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?

Link to comment
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
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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