Beispiel #1
0
        public Point GetPoint(int loc)
        {
            Point p = new Point(0, 0);

            switch (loc)
            {
            case 0:
                return(new Point(Form1.W, Form1.H));
            }

            p = Alg.GetPoint(loc);
            return(p);
        }
Beispiel #2
0
        public Game()
        {
            try
            {
                FileStream   inFile = new FileStream("Setting.txt", FileMode.Open);
                StreamReader sr     = new StreamReader(inFile);
                string       st     = sr.ReadLine();
                map = new Map(this, st[0] - '0', st[1] - '0');

                st        = sr.ReadLine();
                cntPlayer = st.Length;
                player    = new Player[cntPlayer];
                for (int i = 0; i < cntPlayer; ++i)
                {
                    player[i] = new Player(i, "", st[i].ToString(), map.MapX / 2, map.MapY / 2);
                }
            }
            catch
            {
                map       = new Map(this);
                cntPlayer = 4;
                player    = new Player[cntPlayer];
                player[0] = new Player(0, "", "A", map.MapX / 2, map.MapY / 2);
                player[1] = new Player(1, "", "B", map.MapX / 2, map.MapY / 2);
                player[2] = new Player(2, "", "C", map.MapX / 2, map.MapY / 2);
                player[3] = new Player(3, "", "D", map.MapX / 2, map.MapY / 2);
            }

            //cntPlayer = 4;
            //player = new Player[cntPlayer];
            //player[0] = new Player(0, "", "A", map.MapX / 2, map.MapY / 2);
            //player[1] = new Player(1, "", "B", map.MapX / 2, map.MapY / 2);
            //player[2] = new Player(2, "", "C", map.MapX / 2, map.MapY / 2);
            //player[3] = new Player(3, "", "D", map.MapX / 2, map.MapY / 2);
            //nowPlayerID = -1;

            alg        = new Alg(this);
            help       = new Help(this);
            Mover.game = this;

            nowPlayerID = -1;

            WaitReviving = true;

            NewRound();
        }