keke

Members
  • Content Count

    3
  • Joined

  • Last visited

Everything posted by keke

  1. Using P2 Physics, what's the best way to move a sprite, similar to sprite.body.moveRight, sprite.body.moveLeft but in parallel with another sprite that has a rotation (which constantly changes). I want to be able to move the purple line up and down along the yellow line, in parallel and at a fixed distance while they both rotate. Anya ideas? Thanks
  2. How about the width and height properties in tiled (0.15.1)? Using Phaser 2.4.6 these properties doesn't seem to be parsed into map.objects
  3. Hi, When changing from one state to another any updates to a p2 body's velocity seems to be ignored. I've created the following codepen to illustrate: http://codepen.io/klas/pen/qbMXmm When changing from FirstState to SecondState (with clearWorld = false ) the player sprite stops moving when using p2 physics even though velocity is still applied in the update function in SecondState. If I change to Arcade physics everything works as expected and the player sprite keeps moving. Maybe I'm just missing something how p2 physics work? Is there some kind of reset needed between states? I've tried re-enabling p2 physics for the player sprite in the Second State with no luck. Update: If I call revive() on the player sprite in the create function of SecondState it seems to solve the issue. Not sure why that is? Updated codepen: http://codepen.io/klas/pen/VeGMpq Thanks