How to make a mirror portal?

SEMASEMA Member Posts: 161

i want to make a mirror portal like the one on geometry dash I can't figure a simple way to do it. Need help.

Comments

  • ericleclairericleclair Member Posts: 10
    edited March 2017

    Go to Youtube and type in Gamesalad Portal :) - I think you'll be pleasantly surprised. User Id of the person is: Just an Indie Developer.

  • SEMASEMA Member Posts: 161

    Yeah, but what I want is a method that will make the actor moving right appear to be moving left like in geometry dash. like on this video skip to 0.25.

  • ToqueToque Member Posts: 1,188
    edited March 2017

    Appear to be moving left??? Isn't it actually moving left? Its moving right then hits portal and moves left?

    collide with portal.
    Change self.velocity x to self.velocity x *-1

    Thats self.velocity x times -1

    That will reverse its X velocity. So if its moving 200 it will then move -200

  • pHghostpHghost London, UKMember Posts: 2,342

    I think what he means is that the whole world flips over. You hit the portal and start moving left, but in terms of the level, you are still moving forward, not back from whence you came.

  • ToqueToque Member Posts: 1,188

    @pHghost said:
    I think what he means is that the whole world flips over. You hit the portal and start moving left, but in terms of the level, you are still moving forward, not back from whence you came.

    oooooh. Sorry.

    Ahhhhh. I watched several times I thought it was being transported to a different place.

    Flipping an entire scene on horizontal.............. Sounds crazy.

    The only way to make that work (in my mind) is to make a huge scene. Make that part of the scene in duplicate but in reverse. Then when you hit that portal just create a flash. Change position of player to the duplicate part that you have already made in reverse. Moving in -velocity of course.

    Nothing flips at all. Just moving actor in to a different part of the scene moving in opposite direction through a premade scene........

  • ToqueToque Member Posts: 1,188
    edited March 2017

    Maybe this makes more sense. This seems the easiest way to me......... Player is following the arrow. Large scene with different sections......

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2017

    //

  • SEMASEMA Member Posts: 161

    @pHghost yes that was what I was trying to do but I think it's not possible. @Toque I think I will do that. Thanks everyone

  • pHghostpHghost London, UKMember Posts: 2,342

    Everything is 'possible.'

    @Toque's suggestion would work. It is the same in principle, as far as gameplay goes.

    The other option is to create the game with a scrolling scene, while the player actor is in a fixed position. Also make a wide scene. When you hit the portal, pause movement for 0.3 seconds and interpolate all scene actor positions to the other side of the hero actor in 0.3 seconds. Horizontally flip their textures.

    That will give you pretty much exactly the same effect as Geometry Dash.

  • ToqueToque Member Posts: 1,188

    @pHghost said:
    Everything is 'possible.'

    @Toque's suggestion would work. It is the same in principle, as far as gameplay goes.

    The other option is to create the game with a scrolling scene, while the player actor is in a fixed position. Also make a wide scene. When you hit the portal, pause movement for 0.3 seconds and interpolate all scene actor positions to the other side of the hero actor in 0.3 seconds. Horizontally flip their textures.

    That will give you pretty much exactly the same effect as Geometry Dash.

    That was my first thought. Flip the scene and horizontal flip actors. I tried a simple scene flip demo and trying to figure out where each actor would have to move relative player.

    Calculate the distance from portal to every object and change their position. Then actors on left move to the right. Things on right move to the left of portal.

    I was hoping someone could offer a simple way to do it as my brain reached capacity, started smoldering, hallucinations of invading socks spiders appeared. I hear a song from the sound track The Sound Of Music "doe a deer a female deer......". Defeated by GS yet again.

    If there are a lot of these portal things flipping is better.

  • ToqueToque Member Posts: 1,188
    edited April 2017

    Actually. Portal position - actors self.position x

    So portal x is 100. Actor position x is 150.

    100-150=-50. Needs to be left 50 of portal.

    If object is x position 50.

    100-50=50. Object needs to be 50 to right of portal.

  • SEMASEMA Member Posts: 161

    thank guys
    I have some work to do

  • SEMASEMA Member Posts: 161

    Guys I just figure a way to flip the world without changing the position like in geometry dash. It was simple and easy.

  • ToqueToque Member Posts: 1,188

    @SEMA said:
    Guys I just figure a way to flip the world without changing the position like in geometry dash. It was simple and easy.

    awesome

  • SEMASEMA Member Posts: 161

    I changed the camera rotation to 180 and changed all the mechanics of the game to make it appear going.

  • ToqueToque Member Posts: 1,188

    I was thinking another cool effect would be to flip the game upside down.

  • SEMASEMA Member Posts: 161

    @Toque I already implemented that to my game.

  • ToqueToque Member Posts: 1,188
    edited April 2017

    @SEMA said:
    @Toque I already implemented that to my game.

    So cool

Sign In or Register to comment.