matter-js
matter-js copied to clipboard
Create a platformer examples
Hi !
A platformer game example would be awesome to begin with the engine. As I said in issue #335 , it can a bit hard to developp a platformer with the current findable ressouces.
The only one I found is : https://codepen.io/tanker837/pen/qaeQKZ
If somebody got something else, i'll be thankful.
@hilde2 - I think this is a great idea, and actually from my experience with MatterJS (making a simple slingshot game), I don't expect it would be too difficult. What would you be specifically looking for in terms of how it would be broken down? If you can help me plan out such a tutorial I would be more than happy to write it.
I've also proposed some improvements to documentation (Issue #373), so check that out and see if any of my suggestions there would be useful. Any feedback on potential challenges you've had would be very useful.
There is a bit of work to make something good for a platformer. A documented tutorial like you explain in #373 could be awesome.
Something that I like and I found really usefull is what you can found in P2.js examples : https://github.com/schteppe/p2.js/blob/master/examples/canvas/platformer.html I made a quick js fiddle if you want to try it : https://jsfiddle.net/2h4ah4k1/ This help a lot to start a platformer project on the P2 engine :
- Learn how to make the body stop rotating
- Collissions detector
- Slope
- etc ...
And there is still this tunneling bug #335 . In this is issue there is this example : https://jsfiddle.net/hsassewa/ This just show the basics, like collissions sensors, and non rotating bodies.
I'm a bit of a novice programmer, but I wrote the platformer that you linked on codepen. If anyone has any questions about putting the game together I'd be happy to help.
https://landgreen.github.io/sidescroller/ Press T to enter testing, 0-+ to zoom
I found your codepen really usefull ! But a bit too much complex for the one who just want to try MatterJS.
Agreed, I hope to use @landgreen's code to create a simpler example with just the core mechanics.
i did some coding with pixi js and matter js working together here, https://davidclews.com/post/11.html