How to wrap x and y in a certain area instead of the whole screen?
AleksandrGames
Member Posts: 54
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
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
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page