A great tutorial on creating vehicles and a landscape to drive on in P2 Physics.

Article by Richard Davey. Posted on 14th Jun 2017.   @photonstorm


The LoonRide team are back with another blinding P2 tutorial: "This tutorial will cover a simple way to make vehicles in Phaser and create terrain for them to drive on. You can take a look at what we will be making here, and you can also download the source from Github here.

For this tutorial, I have created a Vehicle function in vehicle.js which you can use to quickly make a car or truck and add wheels to it. I have created a TerrainController function in terrain.js which has methods to add a P2 physics body to the bottom of your game world, and also to draw the outline of this body on the canvas."

Read More