private void DrawPlayer() { MazeBox.Refresh(); DrawGoal(); Graphics g = MazeBox.CreateGraphics(); g.FillRectangle(Brushes.Black, new Rectangle(new Point(MazeModule.PlayerX - 15, MazeModule.PlayerY - 15), new Size(30, 30))); }
private void DrawGoal() { MazeBox.Refresh(); Graphics g = MazeBox.CreateGraphics(); g.DrawRectangle(new Pen(Brushes.Red, 5), new Rectangle(new Point(MazeModule.GoalX - 25, MazeModule.GoalY - 25), new Size(50, 50))); return; }
public void drawStartingMaze() { g.FillRectangle(Brushes.White, 0, 0, 800, 400); Cell aux = new Cell(0, 0); for (int x = 0; x < columns; x++) { for (int y = 0; y < rows; y++) { aux.X = x; aux.Y = y; aux.Show(800 / columns, 400 / rows, g); } } g.FillRectangle(Brushes.Green, inicio.X * (800 / columns) + (800 / columns) / 8, inicio.Y * (400 / rows) + (800 / columns) / 8, 800 / columns - (800 / columns) / 4, 400 / rows - (800 / columns) / 4); g.FillRectangle(Brushes.Red, fim.X * (800 / columns) + (800 / columns) / 8, fim.Y * (400 / rows) + (800 / columns) / 8, 800 / columns - (800 / columns) / 4, 400 / rows - (800 / columns) / 4); MazeBox.Refresh(); }
/// <summary> /// Initialization /// </summary> void Init() { if (DungeonControl.Dungeon == null) { return; } MazeBox.BeginUpdate(); MazeBox.Items.Clear(); foreach (Maze maze in DungeonControl.Dungeon.MazeList) { MazeBox.Items.Add(maze.Name); } MazeBox.EndUpdate(); if (!string.IsNullOrEmpty(DungeonControl.Target.Maze)) { MazeBox.SelectedItem = DungeonControl.Target.Maze; } DirectionBox.SelectedItem = DungeonControl.Target.Direction.ToString(); GroundPositionBox.SelectedItem = DungeonControl.Target.Position.ToString(); }