Jump to content

P2 body doesn't spawn where it should


wernersbacher
 Share

Recommended Posts

Hi,

I've got a shark group with many sharks:

shark = sharks.create(game.width, (HEIGHT - SHARK_SRC * SHARKFACT) * Math.random(), "shark");
            game.physics.p2.enable(shark);
            shark.body.clearShapes();
            shark.body.loadPolygon('sharkP2', 'sharkP2');
            shark.body.velocity.x = -getSpeed();
            shark.body.collideWorldBounds = false;

Since I went from Arcade to P2, they won't spawn at game.width, but rather too early.

There is a live demo online: http://wernersbacher.de/pro/Blubber/

Any help is appreciated! Thanks!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...