Teleport actor? (with GIF)

mi1ezmi1ez Member, PRO Posts: 18
edited July 2013 in Working with GS (Mac)
Well, I can't really explain it, but I want it so when the actor "enters" a certain Y position, it "comes out" from a lower Y position. So as the top of the actor enters portal 1, the top appears to come out of portal 2. I know this probably makes no sense to some, so here's a GIF to show what I mean :) http://makeagif.com/i/aULewc

Comments

  • MantoManto Member Posts: 796
    edited July 2013
    Will your portals be bigger than the teleporting actors?
    Edit: And will the portals work in two directions?
  • BoomshackBarryBoomshackBarry Member Posts: 712
    It's a tricky one, you can't use change position.Y as the ball would snap to the new location rather than have that wrapping effect. You'd have to use two balls, and keep them the certain distance apart from one another on the Y axis, so that as one starts to enter the teleport at the top the other is already beginning to show at the teleport at the bottom, and vice versa. You'd then need some kind of mask actor on the top layer that sits behind the teleports, so that it hides the remainder of the ball so that it looks like it's disappearing in to the teleport.

    Then I guess you'd need rules that say once a ball reaches a certain max or min Y threshold, move the ball back to the top/bottom again so that the balls remain the right distance from one another.

    That's just off the top of my head, I'm on a work PC right now so I can't offer any demo file.
  • mi1ezmi1ez Member, PRO Posts: 18
    @Manto1 yes the portals will work in both directions and will be smaller than the teleporting actors
  • mi1ezmi1ez Member, PRO Posts: 18
    @BoomshackBarry Thanks for the reply! Unfortunately, I don't have a solid background so I don't think putting a mask actor over will work :( Oh well, I'll try to work around it
  • BoomshackBarryBoomshackBarry Member Posts: 712
    use scene wrapping
    Scene wrapping would only work at the edges of the scene though, from the gif it looks like the wrapping needs to occur away from the edge of the screen.

    @mi1ez it doesn't matter if your background is solid as long as it's static, as the mask actor can just be a portion of the same background graphic. But it might not work for you, it all depends how you're building your game.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    edited July 2013
    You could possibly spawn or call to scene another actor.

    So, when ball hits portal 1, track velocity, angle etc.
    Spawn ball2 at portal 2 and change attributes to those you've tracked above.
    When ball passes portal 1, destroy.

    Without masking it so it disappears behind the portal, im not sure how you will give the disappearing effect.

    This is just a quick way that in theory would work, there maybe a nicer way
Sign In or Register to comment.