Changing Scenes Once Off Screen?

so essentially, I want to make it so when a ship i have controlled with WASD goes greater than width, then the scene changes to another one, however the ship gets reset to the center of that new scene. Is that Possibe

1 Like

It’s hard to answer such a question without any code. That is indeed possible, but I don’t really know which way you made your code work.

Although, I suggest you to make new variables for the ship position; before you switch the scene, you store the coordinates of the ship in them, and after you switch the scene, you load your coordinates from there.

1 Like

What you want done converts almost directly into code.

if ( ship.position.x > width ){ // If the ship's position is outside the screen on the right,
  scene_number++; // Go to the next scene.
  ship.position.x = width/2; // And recenter the ship.
  ship.position.y = height/2;
}
2 Likes