Level descriptions & stupid startup crash fixed
This commit is contained in:
parent
516af06aea
commit
a4d31deacd
8 changed files with 77 additions and 15 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -5,6 +5,7 @@ using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
@ -1056,6 +1057,11 @@ namespace GATE_PLAYGROUND
|
||||||
"1;1,0.*=0.*~10000,PIPES;-84;-85,string1,",
|
"1;1,0.*=0.*~10000,PIPES;-84;-85,string1,",
|
||||||
"1;2,0.*=0.*+1.*~10000,PIPES;-84;-85;LOGIC,string2,"
|
"1;2,0.*=0.*+1.*~10000,PIPES;-84;-85;LOGIC,string2,"
|
||||||
};
|
};
|
||||||
|
public static List<string> levelDescriptions = new List<string>()
|
||||||
|
{
|
||||||
|
"Connect the input with the output in a way that results in them transmitting a signal.",
|
||||||
|
"Connect the input with the outputs in a way that an incoming signal arrives at both outputs."
|
||||||
|
};
|
||||||
public static List<List<int>> levelInputs;
|
public static List<List<int>> levelInputs;
|
||||||
public static List<List<int>> levelOutputs;
|
public static List<List<int>> levelOutputs;
|
||||||
public static List<string> winConditions = new List<string>();
|
public static List<string> winConditions = new List<string>();
|
||||||
|
|
@ -1272,8 +1278,17 @@ namespace GATE_PLAYGROUND
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[DllImport("user32.dll")]
|
||||||
|
public static extern bool ShowWindow(System.IntPtr hWnd, int cmdShow);
|
||||||
|
|
||||||
|
private static void Maximize()
|
||||||
|
{
|
||||||
|
Process p = Process.GetCurrentProcess();
|
||||||
|
ShowWindow(p.MainWindowHandle, 3); //SW_MAXIMIZE = 3
|
||||||
|
}
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
Maximize();
|
||||||
SetScreenColorsApp.SetColor(ConsoleColor.Magenta, Color.DarkOrange);
|
SetScreenColorsApp.SetColor(ConsoleColor.Magenta, Color.DarkOrange);
|
||||||
SetScreenColorsApp.SetColor(ConsoleColor.DarkYellow, Color.LightSkyBlue);
|
SetScreenColorsApp.SetColor(ConsoleColor.DarkYellow, Color.LightSkyBlue);
|
||||||
SetScreenColorsApp.SetColor(ConsoleColor.Green, Color.SpringGreen);
|
SetScreenColorsApp.SetColor(ConsoleColor.Green, Color.SpringGreen);
|
||||||
|
|
@ -1497,6 +1512,13 @@ namespace GATE_PLAYGROUND
|
||||||
}
|
}
|
||||||
Console.Clear();
|
Console.Clear();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Playground.levelID != "-1")
|
||||||
|
{
|
||||||
|
levelInfo(Int32.Parse(Playground.levelID));
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ConsoleKey.LeftArrow:
|
case ConsoleKey.LeftArrow:
|
||||||
Playground.selectedX--;
|
Playground.selectedX--;
|
||||||
|
|
@ -1685,7 +1707,8 @@ namespace GATE_PLAYGROUND
|
||||||
// Playground.signals[layer][x][y][i] = 0;
|
// Playground.signals[layer][x][y][i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (!second)
|
if (!second)
|
||||||
{
|
{
|
||||||
|
|
@ -1920,7 +1943,8 @@ namespace GATE_PLAYGROUND
|
||||||
Playground.signals[layer][x][y][Playground.sides[side.Substring(0, 1)]] = outputStrength + 2;
|
Playground.signals[layer][x][y][Playground.sides[side.Substring(0, 1)]] = outputStrength + 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(io.Length == 2)
|
}
|
||||||
|
else if (io.Length == 2)
|
||||||
{
|
{
|
||||||
foreach (string side in io[1].Split('+'))
|
foreach (string side in io[1].Split('+'))
|
||||||
{
|
{
|
||||||
|
|
@ -2583,6 +2607,7 @@ namespace GATE_PLAYGROUND
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Playground.nextLvl = options[3];
|
Playground.nextLvl = options[3];
|
||||||
|
levelInfo(Int32.Parse(Playground.levelID));
|
||||||
}
|
}
|
||||||
static void initTest(int conditionID)
|
static void initTest(int conditionID)
|
||||||
{
|
{
|
||||||
|
|
@ -2853,5 +2878,42 @@ namespace GATE_PLAYGROUND
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static void levelInfo(int levelid)
|
||||||
|
{
|
||||||
|
Console.Clear();
|
||||||
|
int width = 60;
|
||||||
|
int height = 20;
|
||||||
|
Console.SetCursorPosition(10, 8);
|
||||||
|
Console.WriteLine("\u2554" + new string('\u2550', width) + "\u2557");
|
||||||
|
Console.SetCursorPosition(10, (height + 10));
|
||||||
|
Console.WriteLine("\u255A" + new string('\u2550', width) + "\u255C");
|
||||||
|
for (int i = 9; i < (height + 10); i++)
|
||||||
|
{
|
||||||
|
Console.SetCursorPosition(10, i);
|
||||||
|
Console.Write("\u2551" + new string(' ', width) + "\u2551");
|
||||||
|
}
|
||||||
|
Console.SetCursorPosition(12, 10);
|
||||||
|
Console.Write("Level " + (levelid + 1));
|
||||||
|
Console.SetCursorPosition(12, 12);
|
||||||
|
Console.Write("Description:");
|
||||||
|
Console.SetCursorPosition(12, 13);
|
||||||
|
string desc = Playground.levelDescriptions[levelid];
|
||||||
|
int c = 0;
|
||||||
|
for (int i = 0; i < desc.Length; i += (width - 2))
|
||||||
|
{
|
||||||
|
Console.SetCursorPosition(12, 13 + c);
|
||||||
|
Console.Write((desc + new string(' ', width)).Substring(i, width - 2).Trim());
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
int mc = 0;
|
||||||
|
Console.SetCursorPosition(12, 14 + c);
|
||||||
|
Console.Write("Enabled Modules:");
|
||||||
|
foreach (int m in Playground.enabledModules)
|
||||||
|
{
|
||||||
|
display(m, 12 + ((mc % 10) * 6), 15 + c + (int)(mc / 10), true);
|
||||||
|
mc++;
|
||||||
|
}
|
||||||
|
Console.ReadKey();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue