using System.Collections.Generic;
public static int keyX = 0;
public static int keyY = 0;
public static int keyZ = 0;
public static bool hasKey = false;
public static int playerX = 0;
public static int playerY = 0;
public static int playerZ = 0;
public static void Main()
public static void RandomGenerateKey()
System.Random random = new System.Random();
public static void AskForMovement()
Console.WriteLine("what action do you want to envoke? *Up, Down, Left, Right*");
MovePlayer(Console.ReadLine().ToLower());
public static void MovePlayer(string dir)
System.Random random = new System.Random();
if (dir == "up" || dir == "down" || dir == "left" || dir == "right" || dir == "placing" || dir == "blockcreate" || dir == "3d")
if (dir == "up" && playerY != 3){playerY = playerY + 1;}
else if (dir == "down" && playerY != 0){playerY = playerY - 1;}
else if (dir == "left" && playerX != 0){playerX = playerX - 1;}
else if (dir == "right" && playerX != 3){playerX = playerX + 1;}
else if (dir == "3d"){AskForMovement2();}
else{Console.WriteLine("FAILED TO MOVE");}
else if(dir != "up" || dir != "down" || dir != "left" || dir != "right" || dir != "placing" || dir != "blockcreate"){
public static void GotKey()
Console.WriteLine("Do you want to use your key? *'yes' or 'no'*");
string reply = Console.ReadLine();
if(reply.ToLower() == "yes")
Console.WriteLine("You won!");Console.WriteLine("You won!");Console.WriteLine("You won!");Console.WriteLine("You won!");Console.WriteLine("You won!");
Console.WriteLine("You won!");Console.WriteLine("You won!");Console.WriteLine("You won!");Console.WriteLine("You won!");Console.WriteLine("You won!");
Console.WriteLine("You won!");Console.WriteLine("You won!");Console.WriteLine("You won!");Console.WriteLine("You won!");Console.WriteLine("You won!");
Console.WriteLine("You have now unlocked the axis 'Z'!");
else if(reply.ToLower() == "no")
public static void PrintPlayer()
if (playerX == 3 && playerY == 3 && hasKey == true){Console.WriteLine("###X\n####\n####\n####\n"); GotKey();}
else if (playerX == 0 && playerY == 0){Console.WriteLine("####\n####\n####\nX###\n");}
else if (playerX == 1 && playerY == 0){Console.WriteLine("####\n####\n####\n#X##\n");}
else if (playerX == 2 && playerY == 0){Console.WriteLine("####\n####\n####\n##X#\n");}
else if (playerX == 3 && playerY == 0){Console.WriteLine("####\n####\n####\n###X\n");}
else if (playerX == 0 && playerY == 1){Console.WriteLine("####\n####\nX###\n####\n");}
else if (playerX == 0 && playerY == 2){Console.WriteLine("####\nX###\n####\n####\n");}
else if (playerX == 0 && playerY == 3){Console.WriteLine("X###\n####\n####\n####\n");}
else if (playerX == 1 && playerY == 1){Console.WriteLine("####\n####\n#X##\n####\n");}
else if (playerX == 2 && playerY == 1){Console.WriteLine("####\n####\n##X#\n####\n");}
else if (playerX == 3 && playerY == 1){Console.WriteLine("####\n####\n###X\n####\n");}
else if (playerX == 1 && playerY == 2){Console.WriteLine("####\n#X##\n####\n####\n");}
else if (playerX == 1 && playerY == 3){Console.WriteLine("#X##\n####\n####\n####\n");}
else if (playerX == 2 && playerY == 2){Console.WriteLine("####\n##X#\n####\n####\n");}
else if (playerX == 2 && playerY == 3){Console.WriteLine("##X#\n####\n####\n####\n");}
else if (playerX == 3 && playerY == 2){Console.WriteLine("####\n###X\n####\n####\n");}
else if (playerX == 3 && playerY == 3){Console.WriteLine("###X\n####\n####\n####\n");}
if (playerX == keyX && playerY == keyY)
Console.WriteLine("You got the Key!\n Now to go the top Right to enter the next level!");
Console.WriteLine("You got the Key!\n Now to go the top Right to enter the next level!");
Console.WriteLine("You got the Key!\n Now to go the top Right to enter the next level!");
Console.WriteLine("You got the Key!\n Now to go the top Right to enter the next level!");
Console.WriteLine("You got the Key!\n Now to go the top Right to enter the next level!");
Console.WriteLine("You got the Key!\n Now to go the top Right to enter the next level!");
public static void RandomGenerateKey2()
System.Random random = new System.Random();
public static void MovePlayer2(string dir)
System.Random random = new System.Random();
if (dir == "up" || dir == "down" || dir == "left" || dir == "right" || dir == "placing" || dir == "blockcreate" || dir == "jumpdown" || dir == "jumpup" || dir == "2d")
if (dir == "up" && playerY != 3){playerY = playerY + 1;}
else if (dir == "down" && playerY != 0){playerY = playerY - 1;}
else if (dir == "left" && playerX != 0){playerX = playerX - 1;}
else if (dir == "right" && playerX != 3){playerX = playerX + 1;}
else if (dir.ToLower() == "jumpup" && playerZ != 3){playerZ = playerZ + 1;}
else if (dir.ToLower() == "jumpdown" && playerZ != 0){playerZ = playerZ - 1;}
else if (dir == "2d"){AskForMovement();}
else{Console.WriteLine("FAILED TO MOVE");}
else if(dir != "up" || dir != "down" || dir != "left" || dir != "right" || dir != "placing" || dir != "blockcreate"){
public static void PrintPlayer2()
if (playerX == 3 && playerY == 3 && playerZ == 0 && hasKey == true){Console.WriteLine("###X\n####\n####\n####\n"); GotKey();}
else if (playerX == 0 && playerY == 0 && playerZ == 0){Console.WriteLine("####\n####\n####\nX###\n");}
else if (playerX == 1 && playerY == 0 && playerZ == 0){Console.WriteLine("####\n####\n####\n#X##\n");}
else if (playerX == 2 && playerY == 0 && playerZ == 0){Console.WriteLine("####\n####\n####\n##X#\n");}
else if (playerX == 3 && playerY == 0 && playerZ == 0){Console.WriteLine("####\n####\n####\n###X\n");}
else if (playerX == 0 && playerY == 1 && playerZ == 0){Console.WriteLine("####\n####\nX###\n####\n");}
else if (playerX == 0 && playerY == 2 && playerZ == 0){Console.WriteLine("####\nX###\n####\n####\n");}
else if (playerX == 0 && playerY == 3 && playerZ == 0){Console.WriteLine("X###\n####\n####\n####\n");}
else if (playerX == 1 && playerY == 1 && playerZ == 0){Console.WriteLine("####\n####\n#X##\n####\n");}
else if (playerX == 2 && playerY == 1 && playerZ == 0){Console.WriteLine("####\n####\n##X#\n####\n");}
else if (playerX == 3 && playerY == 1 && playerZ == 0){Console.WriteLine("####\n####\n###X\n####\n");}
else if (playerX == 1 && playerY == 2 && playerZ == 0){Console.WriteLine("####\n#X##\n####\n####\n");}
else if (playerX == 1 && playerY == 3 && playerZ == 0){Console.WriteLine("#X##\n####\n####\n####\n");}
else if (playerX == 2 && playerY == 2 && playerZ == 0){Console.WriteLine("####\n##X#\n####\n####\n");}
else if (playerX == 2 && playerY == 3 && playerZ == 0){Console.WriteLine("##X#\n####\n####\n####\n");}
else if (playerX == 3 && playerY == 2 && playerZ == 0){Console.WriteLine("####\n###X\n####\n####\n");}
else if (playerX == 3 && playerY == 3 && playerZ == 0){Console.WriteLine("###X\n####\n####\n####\n");}
else if (playerX == 0 && playerY == 0 && playerZ == 1){Console.WriteLine("----\n----\n----\nX---\n");}
else if (playerX == 1 && playerY == 0 && playerZ == 1){Console.WriteLine("----\n----\n----\n-X--\n");}
else if (playerX == 2 && playerY == 0 && playerZ == 1){Console.WriteLine("----\n----\n----\n--X-\n");}
else if (playerX == 3 && playerY == 0 && playerZ == 1){Console.WriteLine("----\n----\n----\n---X\n");}
else if (playerX == 0 && playerY == 1 && playerZ == 1){Console.WriteLine("----\n----\nX---\n----\n");}
else if (playerX == 0 && playerY == 2 && playerZ == 1){Console.WriteLine("----\nX---\n----\n----\n");}
else if (playerX == 0 && playerY == 3 && playerZ == 1){Console.WriteLine("X---\n----\n----\n----\n");}
else if (playerX == 1 && playerY == 1 && playerZ == 1){Console.WriteLine("----\n----\n-X--\n----\n");}
else if (playerX == 2 && playerY == 1 && playerZ == 1){Console.WriteLine("----\n----\n--X-\n----\n");}
else if (playerX == 3 && playerY == 1 && playerZ == 1){Console.WriteLine("----\n----\n---X\n----\n");}
else if (playerX == 1 && playerY == 2 && playerZ == 1){Console.WriteLine("----\n-X--\n----\n----\n");}
else if (playerX == 1 && playerY == 3 && playerZ == 1){Console.WriteLine("-X--\n----\n----\n----\n");}
else if (playerX == 2 && playerY == 2 && playerZ == 1){Console.WriteLine("----\n--X-\n----\n----\n");}
else if (playerX == 2 && playerY == 3 && playerZ == 1){Console.WriteLine("--X-\n----\n----\n----\n");}
else if (playerX == 3 && playerY == 2 && playerZ == 1){Console.WriteLine("----\n---X\n----\n----\n");}
else if (playerX == 3 && playerY == 3 && playerZ == 1){Console.WriteLine("---X\n----\n----\n----\n");}
if (playerX == keyX && playerY == keyY)
Console.WriteLine("You got the Key!\n Now to go the top Right to enter the next level!");
Console.WriteLine("You got the Key!\n Now to go the top Right to enter the next level!");
Console.WriteLine("You got the Key!\n Now to go the top Right to enter the next level!");
Console.WriteLine("You got the Key!\n Now to go the top Right to enter the next level!");
Console.WriteLine("You got the Key!\n Now to go the top Right to enter the next level!");
Console.WriteLine("You got the Key!\n Now to go the top Right to enter the next level!");
public static void AskForMovement2()
Console.WriteLine("what action do you want to envoke? *Up, Down, Left, Right, JumpUp, JumpDown*");
Console.WriteLine("Current Pos: X="+playerX+", Y="+playerY+", Z="+playerZ);
MovePlayer2(Console.ReadLine().ToLower());