phaser-arcade-slopes icon indicating copy to clipboard operation
phaser-arcade-slopes copied to clipboard

Phaser 3

Open Maeggi opened this issue 6 years ago • 14 comments

Hello, planned a update to phaser 3?

Maeggi avatar Apr 18 '18 13:04 Maeggi

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 avatar Apr 19 '18 13:04 hexus

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 avatar Jun 24 '18 22:06 hexus

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

hexus avatar Aug 21 '18 22:08 hexus

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

hexus avatar Aug 28 '18 19:08 hexus

That's amazing, thank you so much :+1:

Maeggi avatar Aug 29 '18 15:08 Maeggi

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 :)

AndreaBoeAbrahamsen avatar May 12 '19 13:05 AndreaBoeAbrahamsen

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

hexus avatar May 12 '19 15:05 hexus

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 😃

AndreaBoeAbrahamsen avatar May 12 '19 19:05 AndreaBoeAbrahamsen

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

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.

hexus avatar May 12 '19 22:05 hexus

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?

SHG42 avatar Apr 10 '20 16:04 SHG42

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.

hexus avatar Apr 10 '20 22:04 hexus

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

eliseubaldo avatar Feb 08 '21 21:02 eliseubaldo

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

valueerrorx avatar May 24 '21 19:05 valueerrorx

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.

hexus avatar May 25 '21 02:05 hexus