Wrap X and Y

krousty_batkrousty_bat Member Posts: 48
edited November -1 in Working with GS (Mac)
I would like to know if it's possible to wrap per layer or type of objects ?...

My scene and camera is not moving, My background is a scrolling pic that repeat with random Loop piece (so no warp)
But I would like some or all of my playable Actors to Wrap if they go out of the screen, and not bounce on invisible walls to stay on the screen.

Thx

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692
    No it's not possible :( but one way round this could be to reposition the actors if they go off screen.

    If self.position.x < 0 change attribute self.position.x to 480 for eg.

    Darren.
  • krousty_batkrousty_bat Member Posts: 48
    OK, Thx
    That would have been my second Option, :)...

    I guess to simulate a Wrap, would actually not to reposition, for the all sprite would disappear, but spawn a second object with the same velocity as soon as the object start to be off screen to start to show the missing part on the other part of the screen... well, i'll try that... :)
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    krousty_bat said:
    OK, Thx
    That would have been my second Option, :)...

    I guess to simulate a Wrap, would actually not to reposition, for the all sprite would disappear, but spawn a second object with the same velocity as soon as the object start to be off screen to start to show the missing part on the other part of the screen... well, i'll try that... :)

    If you keep spawning every time it runs off the scene you could hurt your performance especially on the older devices.
  • krousty_batkrousty_bat Member Posts: 48
    Thx Tendrdrmer
    Right now, i'm trying it, for the sake of testing or learning mostly :)...

    So, it's kind of easy, Creating a rule with "Spawn actor" in the wanted position, and "Destroy" when the first one is not visible anymore... What I don't really succeed to do is to "transfer" the Velocity and angle of direction to my new spawn...
Sign In or Register to comment.