Ejemplo n.º 1
0
        public Form1(AbstPlayer p1, AbstPlayer p2)
        {
            InitializeComponent();
            Text           = "Geister";
            StartPosition  = FormStartPosition.CenterScreen;
            ClientSize     = new Size(950, 700);    //エリアが500*600,上下50左右100が余白,右300でその他情報
            BackColor      = Color.MediumSlateBlue; //
            DoubleBuffered = true;

            Init(p1, p2);

            System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
            timer.Interval = 1;
            timer.Tick    += new EventHandler(Test_Tick);
            timer.Start();
        }
Ejemplo n.º 2
0
        private void Init(AbstPlayer p1, AbstPlayer p2)
        {
            global.Turn     = 0;
            global.Eflag_p1 = new List <int>()
            {
                -1, -1, -1
            };
            global.Eflag_p2 = new List <int>()
            {
                -1, -1, -1
            };
            global.currentplayer = Player.P2;
            winflag  = 0;
            stopflag = 0;
            pattern  = 0;
            Bpos     = new Point(-1, -1);

            global.log = new Log[global.FinalTurn];
            for (int i = 0; i < global.FinalTurn; i++)
            {
                global.log[i] = new Log();
            }

            P1 = p1;
            P2 = p2;
            //初期位置設定する? P1.pos1_x, P1.pos1_y
            S1 = new GhostState[global.GhostNum] {
                new GhostState(Player.P1, 0, P1.Init_pos().G0), new GhostState(Player.P1, 1, P1.Init_pos().G1),
                new GhostState(Player.P1, 2, P1.Init_pos().G2), new GhostState(Player.P1, 3, P1.Init_pos().G3),
                new GhostState(Player.P1, 4, P1.Init_pos().G4), new GhostState(Player.P1, 5, P1.Init_pos().G5)
            };                                                                                           //
            S2 = new GhostState[global.GhostNum] {
                new GhostState(Player.P2, 0, (P2.Init_pos().G0)), new GhostState(Player.P2, 1, P2.Init_pos().G1),
                new GhostState(Player.P2, 2, P2.Init_pos().G2), new GhostState(Player.P2, 3, P2.Init_pos().G3),
                new GhostState(Player.P2, 4, P2.Init_pos().G4), new GhostState(Player.P2, 5, P2.Init_pos().G5)
            };                                                                                           //
        }