Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Not sure if anyone else has taken a look at this, but i've managed to sort of resolve the issue with this bit of code being applied in the update function. //cludgy fix for draggable body laggingthis.playerShip.body.x = this.playerShip.world.x - this.playerShip.width/2;this.playerShip.body.y = this.playerShip.world.y - this.playerShip.height/2;I'm not thrilled with the solution, so I'd be more than happy to hear any alternative suggestions to this fix as it still lags behind the sprite just a bit.
  2. Hey Rich, In order to provide more information I'm attaching the main state script I'm using for gameplay. var playerShip;function Play() { //var self = this; this.background; this.playerShip; this.shipStartX = 380; this.shipStartY = 500; //0 - randomly generating along x, with random 15 degree angles, at random speeds //1 - generating a line //2 - generating a sin wave this.asteroidGenerationType = 0; this.asteroidGenerationTimer = 0; this.asteroidGenerationTimeLimit = 50; this.asteroidGenerationTypeIsRandom = false; this.asteroidTimerIsRandom = false; this.asteroidTimerRandom
  3. Hey there Rich! I'm sorry about my delayed response. If I comment that line out it changes nothing, and the bug is still reproducible by dragging the ship.
  4. Rich, Thank you so much for taking the time to respond to this question. I really appreciate the input you provided, however, by default my Ship "class" already disabled the moves property for the body portion of the sprite. Is there something else that could be contributing to this? Below is my class declaration for the ship. Ship = function(x, y) { //Object configurations // self = this; this.imageName = 'rocket'; this.fakeStartY = 0; this.fakeEndY = -1000; this.fakeVelocityY = 0; this.fakeAccelerationY = 1; this.distanceTravelledY = 0; this.playerPressingShip = false; this.s
  5. Is there anything I can add to help out for this question? Am I misinterpreting how Phaser's physics work. Please let me know if I can provide anything else to help with my question.
  6. Hello there. Been playing with Phaser, it's pretty cool. Not sure if this has been asked before, I tried fairly hard in order to answer this on my own. I have a sprite (a space ship) that has has had input.enableDrag set for it. This works without issue. I have also enabled arcade physics. Which also work fine. The issue here is that when I drag the sprite the body associated with the sprite, the body lags behind on movement. This creates an interesting "race condition" where the body is updating to the position that the sprite actually is at, and in turn is having the wrong collision loca
  • Create New...