How to make object leave the screen and reenter on the other side?

ShineHouseGamesShineHouseGames Member, PRO Posts: 100
edited April 2012 in Working with GS (Mac)
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 :D

Best Answer

  • mynameisacemynameisace Hull, UKPosts: 2,484
    edited April 2012 Accepted Answer
    On the scene tab, just tick wrap x ;)

    Ace

Answers

  • quantumsheepquantumsheep Member Posts: 8,188
    On the scene tab, just tick wrap x ;)

    Ace

    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 :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • ShineHouseGamesShineHouseGames Member, PRO Posts: 100
    Really appreciate your quick responses, even at such a late hour. Thanks fellerrrz
  • quantumsheepquantumsheep Member Posts: 8,188
    Really appreciate your quick responses, even at such a late hour. Thanks fellerrrz
    No problem. Ace and I never sleep. We just 'wait'.

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • EatingMyHatEatingMyHat Member Posts: 1,246
    Really appreciate your quick responses, even at such a late hour. Thanks fellerrrz
    What's nice is that it is not even night in some places around the world :)

    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

Sign In or Register to comment.