Hello, I’m new to Phaser, and I’m trying to follow a tutorial to wrap the sprite around after it exits the screen (something like asteroids). I believe i’ve checked the Phaser physics arcade example on wrapping, but the following line gives me the following typescript error.
function update() {
if (this.ship) {
if (this.cursors.left.isDown) {
this.ship.setAngularVelocity(-150);
} else if (this.cursors.right.isDown) {
this.ship.setAngularVelocity(150);
} else {
this.ship.setAngularVelocity(0);
}
if (this.cursors.up.isDown) {
this.physics.velocityFromRotation(this.ship.rotation + 1.5, 100, this.ship.body.acceleration);
} else {
this.ship.setAcceleration(0);
}
this.physics.world.wrap(this.ship, 5); // <-- This line causes the error
}
}
I would greatly appreciate any advice!