I just died in the City of Gold because I thought I knew how the teleporter worked. According to the Spelunky HD Wiki:
Pressing the action button while carrying one will teleport you in the direction you are facing. You will appear a random number of tiles away in the direction you are holding, either 4-8 tiles horizontally or upwards, or 5-9 tiles downwards. Note that you have to jump in order to teleport downwards; otherwise you will just drop the teleporter.
If the destination tile is a solid block, the teleporter tries to find an empty space up to 3 tiles above the selected location - If there is no viable space, the teleporter will warp you into a solid block and you will be killed.
Whenever I use the teleporter, does the game try to find an empty space within the range of the user, then try to find empty space above to put you in, or does the game pick a random number between 4 and 8 and if the tile it wants to put you in is empty it tries to find a tile above?
Consider the following situation:
0 1 2 3 4 5 6 7 8 9
0 [ ][X][X][X][X][X][X][X][X][X]
1 [ ][X][X][X][X][X][ ][X][X][X]
2 [ ][X][X][X][X][X][ ][X][X][X]
3 [ ][X][X][X][X][X][ ][X][X][X]
4 [ ][X][X][X][X][X][ ][X][X][X]
5 [P][X][X][X][X][X][ ][X][X][X]
6 [X][X][X][X][X][X][X][X][X][X]
Where P
is the player and X
are filled tiles. If I try to teleport, will I always survive since there is an open tile 6 tiles in front of me, which is within the 4-8 horizontal range or will I probably die because the game has a 3/4 chance of trying to place me on a tile that has no open spaces above me?
In other words, how forgiving is the game with the teleporter? I had space about 6 tiles away, but still died. Did the game decide to put me 5 tiles ahead, find that that tile and all tiles above it were occupied, and telefrag me?
I am aware that there is already an answer to What is the teleporter and how does it work?. However, I want to know why I am dying whenever I theoretically have open space in the destination range and that answer does not go into sufficient mechanical depth.