- Home /
Make an endless hallway?
So i'm currently been working on a 2d horror game that i've been working on for a few months now, and don't really know how to go about starting this so I was hoping the lovely people here could help me out again. I would like to make an endless hallway made from sprites similar to this shown in the video (https://www.youtube.com/watch?v=l5MLkmT0hqo) so that the character doesn't actually progress anywhere but feels as if they are moving. I'm unsure of having the player only progress back to their starting position or what to do. Any help is appreciated, thanks!
Answer by WarmedxMints · Feb 28, 2019 at 08:42 PM
You move the background rather than the player and just have it move back in front of the player when off screen. So you have say 3 background objects, each the size of the screen. When one is to the left and off screen, you move it to a point on the right next to the background which is on just on screen. So the player feels like they are moving right when reality they aren't moving at all. Take a look at either some flappy bird clone tutorials or endless runner. They will have what you need.
So if my hallway looks sort of like this...
Then I would just need to make it longer with less objects to make it appear as if they are still moving but they are actually being sent back to an original position that looks similar to the end position to make it appear as if its looping?
No, the wall and floor you duplicate so you have 3 of them. You place them next to each other and just move them left. Imagine these are the 3 copies of the background [1] [2] [3]. [1] starts off displayed on screen. As you move the 3 images left, when [2] is displayed on screen, you move [1] to the right of [3] so you end up with [2] [3] [1] and just keep cycling them around like that. Things like the unit, table and painting you place randomly as the player moves.
Your answer
![](https://koobas.hobune.stream/wayback/20220612192702im_/https://answers.unity.com/themes/thub/images/avi.jpg)