Actor spawner issues. How to spawn outside the screen with scene wrapX enabled?

ohtukrwohtukrw Sir dogeMember Posts: 106
edited July 2016 in Help Wanted

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? :blush:

Comments

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

    Make the scene wider than the screen.

  • ohtukrwohtukrw Sir doge Member Posts: 106

    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.

  • IceboxIcebox Member Posts: 1,485
    edited July 2016

    @ohtukrw said:
    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

  • ohtukrwohtukrw Sir doge Member Posts: 106

    @Icebox said:

    @ohtukrw said:
    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.

Sign In or Register to comment.