I am trying following with this post:
and now I want to make the tank move on the land especially move on the slope. Does anyone have any ideas? Thank you.
CodePudding user response:
As I remenmber for your earlier question, I assume you are using arcade
physics, with that in mind, the answer is, it is "impossible" to move on slopes, except you want to do excessive calculation or so.
The best option is, if you switch to matter
physics engine (matter.js). There this would work easy, and without special calculation and/or hacks. Just check out this exmaple for the official website https://phaser.io/examples/v3/view/physics/matterjs/add-body-to-text.
There is one Caveat: the matter
engine works and is configured abit different than the arcade
engine, so you would have to update most of your physics code.