ISOmetric Posted December 8, 2016 Share Posted December 8, 2016 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 More sharing options...
samme Posted December 8, 2016 Share Posted December 8, 2016 I guess it’s possible the circles are getting caught between the rectangles somehow. Try to verify that the rectangles’ bodies are actually flush with each other. You can also play around with Phaser.Physics.Arcade#OVERLAP_BIAS or use a single physics encompassing all the rectangles (if possible). Link to comment Share on other sites More sharing options...
ISOmetric Posted December 8, 2016 Author Share Posted December 8, 2016 (edited) 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 December 8, 2016 by ISOmetric Added Sandbox Link Link to comment Share on other sites More sharing options...
Recommended Posts