Skip to content
Snippets Groups Projects
Commit fa27e2be authored by bionic85's avatar bionic85
Browse files

FixedMerge

parent 05f94da9
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ namespace PuzzlePlayer_Namespace
public Maze(int size = 20)
{
//drawFactor = 1;
drawFactor = 1;
// init all 2D array's
Reset(size);
}
......@@ -365,10 +365,10 @@ namespace PuzzlePlayer_Namespace
return null;
}
/* Add later
public override void TileInput(Point p, Keys key)
public override void TileInput(Point? p, Keys key)
{
(bool top, bool right, bool bottom, bool left) = getWallsFromNumber(mazeState[p.X,p.Y]);
(bool top, bool right, bool bottom, bool left) = getWallsFromNumber(mazeState[((Point)p).X,((Point)p).Y]);
switch (key)
{
......@@ -393,11 +393,7 @@ namespace PuzzlePlayer_Namespace
// upadte the spaces where the player has walked
boardState[playerPos.X, playerPos.Y] = 1;
}
*/
public override void TileInput(Point p, int x)
{
throw new NotImplementedException();
}
public override void TileClick(Point p, int x)
{
//MessageBox.Show($"{mazeState[p.X, p.Y]}");
......
......@@ -78,10 +78,8 @@ namespace PuzzlePlayer_Namespace
Board = b;
CreateUI();
Board.boardState[1, 1] = 1;
Board.boardState[2, 2] = 0;
}
private void CreateUI() //sets up ui elements
{
MenuStrip menuStrip = new MenuStrip
......@@ -101,35 +99,7 @@ namespace PuzzlePlayer_Namespace
TextAlign = ContentAlignment.BottomRight,
Font = SettingForm.mainFont,
};
this.Paint += (object o, PaintEventArgs pea) =>
{
board.Draw(bufferedGraphics.Graphics, boardspace);
//bufferedGraphics.Graphics.FillRectangle(Brushes.LightCoral, 220, 30, this.Width - 350, this.Height - 100);
//bufferedGraphics.Graphics.FillRectangle(Brushes.DarkRed, boardspace);
bufferedGraphics.Render();
};
this.Resize += (object o, EventArgs ea) => UpdateUI();
this.Move += (object o, EventArgs ea) => this.Focus();
this.KeyPress += (object o, KeyPressEventArgs kea) => Input(kea.KeyChar);
this.MouseClick += (object o, MouseEventArgs mea) =>
{
if (mea.Button == MouseButtons.Left)
{
Input('[');
return;
}
if (mea.Button == MouseButtons.Right)
{
Input(']');
return;
}
};
Board = b;
CreateUI();
}
private void CreateUI() //sets up ui elements
{
menuStrip.Items.Add(menuSettings);
this.Controls.Add(menuStrip);
void CreateButton(Button b)
......
......@@ -10,7 +10,7 @@ namespace PuzzlePlayer_Namespace
{
internal static void Main(string[] args)
{
Application.Run(new PuzzleForm(new Maze()));
Application.Run(new MainForm()); //nnew PuzzleForm(new Maze())
}
}
......@@ -26,11 +26,8 @@ namespace PuzzlePlayer_Namespace
private void SetUpPuzzleForms()
{
for (int i = 0; i < 5; i++)
{
puzzleForms.Add(new PuzzleForm(new Binary()));
}
puzzleForms.Add(new PuzzleForm(new Binary()));
puzzleForms.Add(new PuzzleForm(new Maze()));
}
private void SetUpUI()
......
PuzzlePlayer/Resources/Maze.jpg

36.4 KiB

PuzzlePlayer/Resources/MazeGray.jpg

36.4 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment