Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phaser 3 #53

Open
Maeggi opened this issue Apr 18, 2018 · 14 comments
Open

Phaser 3 #53

Maeggi opened this issue Apr 18, 2018 · 14 comments

Comments

@Maeggi
Copy link

Maeggi commented Apr 18, 2018

Hello,
planned a update to phaser 3?

@hexus
Copy link
Owner

hexus commented Apr 19, 2018

Yes, I'm planning to port the plugin for Phaser 3.

Development hasn't started yet, but I'm sure it'll show up in Phaser News once released.

@hexus hexus changed the title Phaser 3 Update? Phaser 3 Apr 19, 2018
@hexus
Copy link
Owner

hexus commented Jun 24, 2018

I have plans to release a separate plugin for Phaser 3 that also includes similar improvements for MatterJS, not just Arcade.

i.e. a solution to this problem without sacrificing tiles:
http://labs.phaser.io/view.html?src=src/game%20objects/tilemap/collision/matter%20ghost%20collisions.js

@hexus
Copy link
Owner

hexus commented Aug 21, 2018

Just to update this, hexus/phaser-slopes is now a thing after a month and a half of hacking away at MatterJS! The readme, tagged release and npm publish are in progress.

This is a new Phaser 3 plugin I've written that smooths out tilemap collisions for Matter, but it doesn't do anything for Arcade just yet.

I am still planning to either port or reimplement the behaviour of Arcade Slopes for the Phaser 3 plugin, it just might take a little while. 👼

@hexus
Copy link
Owner

hexus commented Aug 28, 2018

The aforementioned plugin has now been released. I'll post here and close this issue once it supports Arcade Physics.

@Maeggi
Copy link
Author

Maeggi commented Aug 29, 2018

That's amazing, thank you so much 👍

@AndreaBoeAbrahamsen
Copy link

Hope you dont mind me asking what the progress is on this one? I am really excited for slopes support in Phaser 3 Arcade Physics :)

@hexus
Copy link
Owner

hexus commented May 12, 2019

I've taken quite a break from Phaser related work lately, so I haven't continued development on these projects.

I'm still interested in implementing it though, as part of the hexus/phaser-slopes plugin. Feel free to keep an eye on both. Perhaps I'll be able to make some time over the summer. 🙂

@AndreaBoeAbrahamsen
Copy link

Thank you for a quick response, and I understand well the need for a break from such a huge project. I am very interested in trying to implementing slopes in my game, and I would be eternally grateful if you could describe how you would go about implementing one of the slope tile types in Phaser 3, would you still use SAT? Would you override the collie method or would adding the slope collide logic to the processCallback be enough? If you dont have time I understand, thanks anyway 😃

@hexus
Copy link
Owner

hexus commented May 12, 2019

I totally empathise with that enthusiasm! Slopes are game-changers, pun intended. 😄

For the plugin, I would likely override the method if there was no easy way to augment Arcade's behaviour in Phaser 3 (and I'm not expecting there to be an easy way). That's how this Phaser 2 plugin works, and this helps keep the collision/overlap API the same for users of the plugin.

If you wanted to attempt this yourself using some SAT library, Arcade's process callback may well be enough for what you need, as it essentially lets you process the entire collision yourself. Inside such a callback, you could use your own polygon to represent the tile that's being collided with.

The tricky part is keeping these collisions smooth between tiles, and that's why I built a plugin in the first place. It's built to avoid collisions with internal edges; identical edges that belong to different tiles. That's where the real complexities lie.

For a super simple example of using SAT in Phaser 2 though, feel free to check out my phaser-sat-example project. It doesn't integrate with Arcade, but it should give you a pretty good idea.

I'm happier with how I've solved this problem in my initial Phaser 3 plugin, because it doesn't rely on heuristics or painstakingly manually tweaked data. Instead, it uses an algorithm ported from Box2D, which should work in all cases.

@SHG42
Copy link

SHG42 commented Apr 10, 2020

Good afternoon! I found your plugin after Googling around and I wanted to find out if you have any status updates on the Phaser 3 implementation for Arcade slopes?

@hexus
Copy link
Owner

hexus commented Apr 10, 2020

Hello!

I still haven't taken the time to implement this for the Arcade Physics engine in Phaser 3 over the past year because I haven't needed it for my own projects, but keep an eye on the hexus/phaser-slopes repo for new releases.

That plugin implements smooth collisions between contiguous tile edges for MatterJS, and may introduce the same functionality for Arcade Physics in the future too.

@eliseubaldo
Copy link

eliseubaldo commented Feb 8, 2021

Hi,
Just joining @SHG42 and expecting the Phaser 3 update :)

@valueerrorx
Copy link

hey @hexus - thank you very much for this plugin .. unfortunately it seems to have stopped working for phaser 3.54
any ideas ? thank you in advance :-)
Peek 2021-05-24 21-05

@hexus
Copy link
Owner

hexus commented May 25, 2021

Hi @valueerrorx. This plugin (phaser-arcade-slopes) is not Phaser 3 compatible. hexus/phaser-slopes is, however it implements smooth collisions for contiguous internal edges for Matter.js, not Arcade.

Basically, my above comments still stand. I haven't had the chance to work on these plugins in a long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants