Wrap alternative

scribblstudiosscribblstudios Member Posts: 118
edited November -1 in Working with GS (Mac)
Hi guys, I just wanted to know if there was a way to make a single actor wrap on the scene without checking the box in scene attributes? Thanks!

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    When self position x > scene.size.width
    --Change self.position.x to 0
    Otherwise
    --When self.position.x < 0
    ----Change self.position.x to scene.size.width

    That should work for one actor obviously if you know the scene size you can just place a number instead of unlocking the actor to get to the scene attribute.

    ___________________________________________________________________________________
    TEMPLATES AND PROJECT HELP BY TENRDRMER. CLICK HERE!!!

    AppSolute Entertainment on Facebook
    AppSolute Entertainment on iTunes
  • scribblstudiosscribblstudios Member Posts: 118
    Great idea! Thank you so much!
  • quantumsheepquantumsheep Member Posts: 8,188
    For general 'Wrap X' emulation:

    Make two walls. Call them LeftWall, and RightWall

    Then in your scene place:

    One 'LeftWall' - just off the screen to the left :D

    One 'Rightwall' just off the screen to the right

    Another 'Rightwall about 480 pixels to the right of the first 'RightWall'

    The space between the two 'RightWalls' is where you can put your enemies.

    Make some move left - when they hit the left wall make them appear just before the first 'Rightwall' (and they'll continue moving left ad infinitum)

    Make some move right - when they hit a 'RightWall' (either one) make them appear just before the LeftWall.

    When the game starts the right moving baddies will hit the second 'RightWall' (the one on the far, far right) and appear just in front of the LeftWall - they'll then hit the first RightWall and loop back to the LeftWall.

    It sounds worse than it is, but seems to work great so far for me!

    Hope that helps!

    QS :D

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

  • scribblstudiosscribblstudios Member Posts: 118
    Cool! Most creative idea I've seen yet, but it works!
Sign In or Register to comment.