• Content Count

  • Joined

  • Last visited

  1. After a bit more seraching I finally stumbled upon an example. apparently theres a third argument to the physics functions which allows you to load a json object like so: this.load.physics('physicsData', '', this.tunnelPhysicsData);
  2. Hi, I need to generate a terrain mesh procedurally. I am currently doing it with lots of sprites stuck together in a line to generate the contour of the terrain. It works fairly well, but has a few quirks and seems to affect performance badly. What I was thinking of doing is generating the points in the preload function, then from that, draw a line to rendering the terrain, and then use the same points to generate the collision polygon. The issue I found is that the game.load.physics() function works with a url to a json object. Is there a way to pass it a json object that I created in the game itself instead of a url? By the way, I am using P2 physics for this.