Shermz345

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. Hi, I'm making a top-down game with the camera that follows the player. Early on, I realized there was a persistent camera jittering effect when using velocity, so I switched my movement to manually change the players x & y coordinates. However, when I started adding enemies to the game that also had arcade physics bodies, I realized that my bodies would not collide. Looking into this, I found this response from the Phaser devs, saying that the problem would be solved in P2. I switched both my bodies to P2, but they still will not collide. Is there a way I can work around both the camera and collisions issue? Thanks in advance for the help.
  2. Hi, I'm making a top-down game with the camera that follows the player. Early on, I realized there was a persistent camera jittering effect when using velocity, so I switched my movement to manually change the players x & y coordinates. However, when I started adding enemies to the game that also had arcade physics bodies, I realized that my bodies would not collide. Looking into this, I found this response from the Phaser devs, saying that the problem would be solved in P2. I switched both my bodies to P2, but they still will not collide. Is there a way I can work around both the camera and collisions issue? Thanks in advance for the help.
  3. Hi, I've been trying to figure out how to move a sprite in the direction it is facing. I was originally going to use the p2js "thrust" function, but it caused a small jitter with the camera. I then tried to use the Arcade "velocityFromAngle", but it was not accurate enough. Here is the code I have playerBoat.prototype.update = function () { if(wasd.up.isDown ) this.speed += 2; else this.speed -=2; if(this.speed > 0){ //MATH } if(wasd.left.isDown && this.speed > 0){ this.angle -= 1; } else if(wasd.right.isDown && this.speed > 0){ this.angle += 1; } As someone who was never too strong in math, I am a little bit confused as to how to relate the angle and speed to do what I'm trying to do. I'm assuming it's something with vectors, but I could use some direction. Thanks in advance!