Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 18, 2022 12:28 am GMT

Bullet Impact Simulation Using Phaser and Matter

Phaser JS is an open source JavaScript game framework for creating 2d HTML5 game. It is shipped with two physics engine: arcade and matter. While arcade is the one used in the official tutorial of phaser and relatively simple (collision, gravity, etc). Matter is a library of its own and can be used for more complex physics involving mass, density, force, friction, etc

Matter has its own documentation, but also has a documentation on Phaser API docs. So understanding how to use it on Phaser is quite challenging for me as for some things you can use the docs at phaser, but for other things, such as the body module, I need to read the matter docs instead. After some struggle, I managed to create a simple simulation of two bodies colliding with a collision detector. I hope it can be helpful for those who want to try making something in phaser using matter engine

Source code with demo link:
https://github.com/RussianMartabak/matter-impact


Original Link: https://dev.to/zaky_abdur/bullet-impact-simulation-using-phaser-and-matter-3a70

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To