示例#1
0
        public CaptureGame(int collectorShapeCount, Size boardSize)
        {
            _boardSize = boardSize;
            _captureShapes = new ICaptureShape[collectorShapeCount];
            _collector = new Collector(Color.Aqua, new Point(0, 0), new Size(30, 30));

            for (int i = 0; i < _captureShapes.Length; i++)
                _captureShapes[i] = new EllipseCaptureShape(_random, new Size(20, 20), _boardSize, Color.Green, 5);

            for (int i = 0; i < Math.Round(_captureShapes.Length / 4F); i++ )
            {
                _captureShapes[i] = new EllipseCaptureShape(_random, new Size(20, 20), _boardSize, Color.Red, -5);
            }

            for (int i = 0; i < Math.Round(_captureShapes.Length / 10F); i++)
            {
                _captureShapes[i] = new RectangleCaptureShape(_random, new Size(10, 10), _boardSize, Color.Blue, -100);
            }
        }
示例#2
0
        public void LevelUp()
        {
            int x = _captureShapes.Length + 5;

            // WMB.  Resize and add additional shapes the _captureShapes array a
            for (int i = _captureShapes.Length; i < x; i++)
            {
                Array.Resize(ref _captureShapes, _captureShapes.Length + 1);
                if (i % 3 == 0)
                    _captureShapes[i] = new EllipseCaptureShape(_random, new Size(20, 20), _boardSize, Color.Red, 5);
                else if (i % 10 == 0)
                    _captureShapes[i] = new RectangleCaptureShape(_random, new Size(10, 10), _boardSize, Color.Blue, -100);
                else
                    _captureShapes[i] = new EllipseCaptureShape(_random, new Size(20, 20), _boardSize, Color.Green, 5);
            }
        }