diff --git a/PuzzlePlayer/Maze.cs b/PuzzlePlayer/Maze.cs index 0f44895bab1f926ccc5c84857a27507e469aa218..a0d353940593510125713cafef4bbbd73a79cac2 100644 --- a/PuzzlePlayer/Maze.cs +++ b/PuzzlePlayer/Maze.cs @@ -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]}"); diff --git a/PuzzlePlayer/PuzzleForm.cs b/PuzzlePlayer/PuzzleForm.cs index 728b3b4c8ce6f7aaa70f0eeae70e5ec20963da4a..5ab038f2640987a5f329717217eda54f8b715666 100644 --- a/PuzzlePlayer/PuzzleForm.cs +++ b/PuzzlePlayer/PuzzleForm.cs @@ -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) diff --git a/PuzzlePlayer/PuzzlePlayer.cs b/PuzzlePlayer/PuzzlePlayer.cs index de329eb6114bb1522374a58146332d2be4cc075e..49fb09a6f9fc6da5faaa4c55085241a0c2ca3f3a 100644 --- a/PuzzlePlayer/PuzzlePlayer.cs +++ b/PuzzlePlayer/PuzzlePlayer.cs @@ -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() diff --git a/PuzzlePlayer/Resources/Maze.jpg b/PuzzlePlayer/Resources/Maze.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ce6a967411e1676e96c8f2b5abea3e0172953c72 Binary files /dev/null and b/PuzzlePlayer/Resources/Maze.jpg differ diff --git a/PuzzlePlayer/Resources/MazeGray.jpg b/PuzzlePlayer/Resources/MazeGray.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ce6a967411e1676e96c8f2b5abea3e0172953c72 Binary files /dev/null and b/PuzzlePlayer/Resources/MazeGray.jpg differ