How to make object leave the screen and reenter on the other side?
I assume this is extremely basic, which is probably why I am unable to find a solution on the internet. Regardless, does anyone know how I can make it so that when my actor leaves the left side of the screen, he'll directly enter from the right? This is used in one of the given GS templates and in popular games like Doodle Jump + others. I can't figure it out.
PS: I only want it to apply for the X-axis, or the left and right side
PS: I only want it to apply for the X-axis, or the left and right side

Answers
Bang on there!
For a little more control, I actually set up to empty, non moveable actors off each side of the screen called Left_Wall and Right_Wall.
This helps me with 'recycling actors' such as enemies and their positioning.
So you basically have a rule that says if an actor collides with left wall, move them to a position just to the left of the right wall. And vice versa.
You'll have to leave a bit of a gap if you want to make sure that moving from one side of the screen to the other won't mean things go wrong (e.g. moving an actor that hits the left wall onto the right wall will mean it'll get 'stuck' going back and forth from one wall to the next ad infinitum).
Hope that helps,
QS
:
DDr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
QS
:
DDr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
However, it is late for me - so, good night
Follow Eating My Hat on Facebook, Twitter and our Blog
Check out my templates in the GS Marketplace or at the store