Exemple #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            ClientSize     = new Size(1280, 960);
            Location       = new Point(0, 0);
            Text           = "Game of Life";
            DoubleBuffered = true;

            const int rows = 50;
            const int cols = 50;
            const int h    = 18;
            const int w    = 18;

            mGame = new LifeGame(rows, cols, h, w, false);

            mGame.Init(StartLiveRate);
            mAction = Action.None;
            mCount  = 0;
            mPause  = false;
            mSpeed  = MaxSpeed / 2;

            mText = new TextLine(cols * w, 0);

            mTimer          = new System.Timers.Timer();
            mTimer.Elapsed += new System.Timers.ElapsedEventHandler(OnElapsed_TimersTimer);
            mTimer.Interval = 50;
            mTimer.Start();
        }
Exemple #2
0
        //メインフォームのコンストラクタ
        public Form1()
        {
            //ライフゲームクラスをマップサイズ50*50で作成
            lg = new LifeGame(50, 50);
            lg.Initialyze55();

            InitializeComponent();
        }
Exemple #3
0
 private void GameInit(int x, int y)
 {
     Game = new LifeGame(x, y);
     Game.CellsLoop = this.LoopToolStripMenuItem.Checked;
     // 描画先とするImageオブジェクトを作成する
     canvas = new Bitmap(x * CellSize, y * CellSize);
 }