コード例 #1
0
 private void ReloadDemoPicture()
 {
     this.Colors = new List <System.Drawing.Color>();
     this.Colors.Add(this.button2.BackColor);
     this.Colors.Add(this.button3.BackColor);
     this.Colors.Add(this.button4.BackColor);
     this.Colors.Add(this.button5.BackColor);
     this.Colors.Add(this.button6.BackColor);
     this.Colors.Add(this.button9.BackColor);
     this.Colors.Add(this.button10.BackColor);
     this.Game = new SnakeMainProcessor(this.pictureBox1.Height, this.pictureBox1.Width, (int)this.numericUpDown2.Value, this.Colors.ToArray(), this.SettingsList.Select(x => x.Checked).ToList(), this.GameFont, this.openFileDialog1.FileName);
     this.pictureBox1.Image = this.Game.MessageStartContext(this.Game.Height, this.Width);
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: CyberMonster/SnakeGame
 public Form1()
 {
     InitializeComponent();
     Rnd_Gen                      = new Random();
     this.KeyDownControl          = new Control();
     this.KeyDownControl.KeyDown += KeyDownEventHandler;
     this.pictureBox1.Controls.Add(this.KeyDownControl);
     this.GlobalTimer          = new Timer();
     this.GlobalTimer.Tick    += GlobalTimerElapse;
     this.GlobalTimer.Interval = 150;
     this.pictureBox1.Focus();
     this.GlobalTimer.Stop();
     this.GameField         = new SnakeMainProcessor(this.pictureBox1.Height, this.pictureBox1.Width);
     this.pictureBox1.Image = this.GameField.MessageStartContext(this.pictureBox1.Height, this.pictureBox1.Width);
     this.GlobalTimer.Start();
 }
コード例 #3
0
ファイル: GamingForm.cs プロジェクト: CyberMonster/SnakeGame
 public GamingForm(ref ProgramThreads ThreadStack, List <System.Drawing.Color> Colors, List <bool> Settings, int Multipiller, System.Drawing.Font GameFont, int Interval, string Path)//int Interval, string MapPath, bool Mode, Color[] Colors)
 {
     this.ThreadsManager = ThreadStack;
     InitializeComponent();
     Rnd_Gen             = new Random();
     this.KeyDownControl = new Control();
     this.KeyDownControl.PreviewKeyDown += PreviewKeyDownEventHandler;
     this.pictureBox1.Controls.Add(this.KeyDownControl);
     this.GlobalTimer          = new Timer();
     this.GlobalTimer.Tick    += GlobalTimerElapse;
     this.GlobalTimer.Interval = Interval;
     this.pictureBox1.Focus();
     this.GlobalTimer.Stop();
     this.GameField         = new SnakeMainProcessor(this.pictureBox1.Height, this.pictureBox1.Width, Multipiller, Colors.ToArray(), Settings, GameFont, Path);
     this.pictureBox1.Image = this.GameField.MessageStartContext(this.pictureBox1.Height, this.pictureBox1.Width);
     this.GlobalTimer.Start();
 }