Is there any way to keep the player in the middle of the screen and wrap around?

Randomario

  • Posts: 19
For my plane game I am trying to go for making the scene as big as possible, so I made it 9999 tiles high (because you are trying to get as far as possible and it's as close to infinite as I think Stencyl can go), but instead of also making it over 999 tiles wide, to give the player a sense that it scrolls horizontally forever, would it be possible to make the player actor always in the middle of the scene, and also make the camera wrap around (so instead of the player moving to the side at one boundary and wrapping around to the other side, make it appear as the two sides are connected, like a loop).

Doing so should save performance by a lot since there is going to be a lot of obstacles coming in from every side.
I reject your reality and substitute my own!

rob1221

  • *
  • Posts: 9472
Just set the camera to follow the player, so unless you're near the edges of the screen, your player will be centered on the screen.

Randomario

  • Posts: 19
Lol that's what I meant, if I'm at the edges of the scene I still want it to be centered if possible.
I reject your reality and substitute my own!

rob1221

  • *
  • Posts: 9472
That can't be done.  Add scenery to both sides if you have to and just move the player back before the edge.

Randomario

  • Posts: 19
I actually figured out how, I took the wrap-around scene behaviour, and where it says Wrap X, or how many pixels will be visible before the scene wraps, I just changed it to a number like 150 and it will wrap before the player nears the edge of the scene.
I reject your reality and substitute my own!

jaybdemented

  • Posts: 35
You could also try using actors for the background and move the BG actors instead of the plane. That way you can have a endless level.