Actor spawner issues. How to spawn outside the screen with scene wrapX enabled?
ohtukrw
Sir dogeMember Posts: 106
My spawner spawns random coins(actors) to move to -x direction.
I would like them to spawn outside the screen (right hand side), which they do, however the game scene has wrapX option enabled, the coins show up in the left side of the game.
I need wrapX enabled for my background to loop.
How do I spawn coins outside the screen?
Comments
Make the scene wider than the screen.
That messed up my background loop, because the image is exact size.
Off topic though, If i made a scene, let's say 10000 wide, and made my hero move relative to the scene, than vise versa. Theoretically, when the scene ends, how do I return main hero to the very beggining? Or wrap X does the trick? That would probably sort out my lagg issues.
Turn off wrap X and try to make it by this rule
When the actor's position is greater than 10000 go back to 0
if
attribute self.position.X is > 10000+self.size.width/2
change attribute self.position.X to 0-self.size.width/2
Thanks that worked! Sorted my lagg.