Is there a way to loop an actor's position?

omoreno16@wcsmiami.orgomoreno16@wcsmiami.org Member Posts: 10
edited July 2015 in Working with GS (Mac)

im basically trying to make an actor move across the screen and when it gets to the the end of the screen, start at the beginning of the screen and repeat his motion. any suggestions? something like a loop but you cant use loop and move.

Comments

  • anything will help

  • SocksSocks London, UK.Member Posts: 12,822

    You can do this several ways, the obvious first choice would be simply to set your scene to wrap.

    Go to Scene > Attributes > and check Wrap X.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited July 2015

    Try this:

    When self.position x > screen.size width + self.size width/2
    -Change attribute self.position x to 0 - self.size width/2

    Or if it fits your project, you could turn on Wrap X. In this case anything that leaves the screen on left or right, will come out at the opposite side of the screen.

    Mental Donkey Games
    Website - Facebook - Twitter

  • Thank you so much guys. new to gamesalad

Sign In or Register to comment.