How to make a mirror portal?
SEMA
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
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.
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.
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
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........
Maybe this makes more sense. This seems the easiest way to me......... Player is following the arrow. Large scene with different sections......
//
@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
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.
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.
thank guys
I have some work to do
Guys I just figure a way to flip the world without changing the position like in geometry dash. It was simple and easy.
awesome
I changed the camera rotation to 180 and changed all the mechanics of the game to make it appear going.
I was thinking another cool effect would be to flip the game upside down.
@Toque I already implemented that to my game.
So cool