First, to Elwro, the link is working, but maybe your provider filter it, here is a mirror:
https://gofile.io/d/TOmWI3
Second, here are some technical background about the maze and how I made it works:
1. In unity, I set my scene and the display area.
2. I create a gameobject with 3 wall sprite in front of the camera and 2 side walls, that cover exactly the viewing area, it's what I call level 1.
I note the precise coordonate and size of the 5 walls on a notepad
3. Then I create a prefab with each one.
4. I delete the 5 gameobjects create at step 2
5. I create a lot of prefabs based on the five prefabs create at step 3, each with a different wall, some with decoration, lever, etc...
https://ibb.co/tX9fnJF
https://ibb.co/F3hGYy9
6. I repeat the same operation (step 2 to 5) for the level 2, 3, 4 and 5, including the side walls according to the view area and the possible visible wall (in yellow the visible area, in bold, the visible wall, X is the player position):
https://ibb.co/y0dSDXv
7. In unity I create a gameobject list for each visible level and I populate the list using the prefab I made.
Keep in mind that each element must be populate with the same reference wall: if the level 1 element 0 is the standart wall, the element 0 of the level 5 must also be the standart wall and it's the same for the side wall. It allow to see the same type of wall when you move.
https://ibb.co/4131GYN
8. Before the coding part, the display idea is that the player didn't really move as it's a first person 2D display, I only change XY values. I destroy all visible prefab on screen and display the visible ones according to the maze define and new XY values. For the view and the XY modifiers I use this grid (it was not the final version, I update the value while coding):
https://ibb.co/FnC5xR9
9. In the code - Part 1 - Variables:
a. I create 1 gameobject for each possible wall position:
https://ibb.co/FWG5DBC
b. I create 1 vector for each wall position and add the values save at step 2
https://ibb.co/Bc2VjKX
c. I define 2 dimensions string DungeonArray that will store the XY values of each bloc of the maze (here I set a maximum maze of 20 by 20)
I define the XY player variable
I define the direction variable
I define the gameobject that will contain the direction picture and that I will hidde or display depending of the Direction value
I define the gameobject that will contain the direction arrow and the block that will cover them if the player cannot move (I never like the wall bump that most game allow)
https://ibb.co/Kjjst71
d. I define the player position and direction, for now I stock them in playerprefs but one of the goal is to read them from a XML save file.
https://ibb.co/z6vPHKQ
10. In the code - Part 2 - Maze loading:
a. I define a grid to visualize my maze:
https://ibb.co/tpq4hFM
B. I convert my grid into a TXT file it read by column the grid of the previous step, not in line:
https://ibb.co/Q6gxLzN
C. Each cell is define with 3 values :
the X position, the Y position and the visible wall for each cell
https://ibb.co/vdQSQBY
D. Here is the simple parser I use to parse my TXT file and store the data
https://ibb.co/CzKqhNN
E. I destroy all the prefab that may be loaded on the scene
F. I will start displaying wall beginning from the most distant one, that way the less distant wall will hide them and I don't have to care if they are visible or not
11. In the code - Part 3 - Maze display:
a. I create variable that will store the XY value of each potential wall
https://ibb.co/PhSPs7S
b. Depending of the direction the player is looking at, I load the previous variable with the XY value that the player may see
https://ibb.co/GtQXD07
c. Now if the corrected XY values are not negative (if ((L51X >= 0) && (L51Y >= 0))), it mean we are into the maze, then we load in a new variable, the value of the DungeonArray (step 9c) located at the correct XY value (string DUNGEONDATA_L51 = DungeonArray[L51X, L51Y]).
If the variable is not empty, depending of the direction (that change wall visibility checking order), and depending of the cell value, I display or not the correct wall at the correct position
https://ibb.co/kQZ3Qkj
Last point, let's fully explain the above image:
if ((L51X >= 0) && (L51Y >= 0))
==> We test if the corrected XY value are not negative, it mean the viewed wall is inside the maze grid
{
string DUNGEONDATA_L51 = DungeonArray[L51X, L51Y];
==> We strore the DungeonArray at the correctedXY value in a new varaible
if (DUNGEONDATA_L51 != null)
==> we test if the new variable define just above is not null
{
string[] WALLARRAY = DUNGEONDATA_L51.Split('-');
==> We store in the WALLARRAY variable, all the 4 value given in the DUNGEONDATA_L51 variable
if (SCENEIDarray[2] == "0")
==> SCENEIDarray[2] contain the direction, to if direction is 2 (east)
{
if (WALLARRAY[0] != "00")
==> if the first value of WALLARRAY is different of 00, it mean there is a wall but according to the direction, it will not be visible so we don't display it
{
///No wall display here
}
if (WALLARRAY[1] != "00")
==> if the second value of WALLARRAY is different of 00, it mean there is a wall but according to the direction, it will not be visible so we don't display it
{
///No wall display here
}
if (WALLARRAY[2] != "00")
==> if the third value of WALLARRAY is different of 00, it mean there is a wall but according to the direction, it will not be visible so we don't display it
{
///No wall display here
}
if (WALLARRAY[3] != "00")
==> if the fourth value of WALLARRAY is different of 00, it mean there is a wall according to the direction, it will be visible so we display it
{
GameObject Wall_L5_SPAWN = (GameObject)(Instantiate(W5_L05[Convert.ToInt16(WALLARRAY[3]) - 1], Wall_L5_001_2_POS, Quaternion.identity));
==>I instantiate a prefab at the position stored in Wall_L5_001_2_POS variable. If the value of WALLARRAY[3] is 06, Convert.ToInt16(WALLARRAY[3]) - 1 will give 5 and so the prefab is the fith element of the W5_L05 list.
Wall_L5_SPAWN.transform.SetParent(GameObject.FindGameObjectWithTag("Canvas_L5_Walls").transform, false);
==>must be set to disable to allow position, scale and rotation depending to his parent.
Wall_L5_SPAWN.transform.localPosition = Wall_L5_001_2_POS;
==>I force the position of the prefab
}
}
It take me a month to code that (around 4500 lines) but a half year to think how to do it... and I missing a lot of thing in the process, for example, the bobbing camera movement and the moving effect when you move or turn...
As you may read in my youtube comment, I'm looking for a unity teacher...