How to wrap x and y in a certain area instead of the whole screen?

AleksandrGamesAleksandrGames Member Posts: 54
edited March 2015 in Working with GS (Mac)

In my game, there are a lot of enemies flying around, each one is going in a different direction. I want them all to wrap x and y, but only within a certain area (the area is just a giant square "arena" in the middle of the screen)
Thanks in advanced.

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    You'll have to do it manually. For example if your wrap area is from pixel locations 100 to 200 you would set up rules like this in the enemy.

    If self.position x ≥200 Change self.position x to 100

Sign In or Register to comment.