Ejemplo n.º 1
0
        public SplashScreen(GraphicsDevice device, ContentManager theContent, EventHandler theScreenEvent)
            : base(device, theScreenEvent)
        {
            font = theContent.Load <SpriteFont>("Font");
            text = "Press Start";
            Vector2 textSize = font.MeasureString(text);

            textCenter     = new Vector2(device.Viewport.Width / 2, device.Viewport.Height / 2);
            textCenter    -= textSize / 2;
            WVP            = new Matrix[3];
            aspectRatio    = device.Viewport.AspectRatio;
            distance       = 30;
            cameraPosition = distance * Vector3.UnitZ;
            cameraRotation = new Vector3(0, 1, 1);
            WVP[0]         = Matrix.Identity;
            WVP[1]         = Matrix.CreateLookAt(cameraPosition, Vector3.Zero, Vector3.UnitY);
            WVP[2]         = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(55), aspectRatio, 0.1f, 100f);

            op = new Options();
            a  = new Marble[9][];
            b  = new Marble[9][];
            for (int i = 0; i < 4; i++)
            {
                a[i]     = new Marble[i + 5];
                b[i]     = new Marble[i + 5];
                a[8 - i] = new Marble[i + 5];
                b[8 - i] = new Marble[i + 5];
            }
            a[4] = new Marble[9];
            b[4] = a[4];
            for (int i = 0; i < 4; i++)
            {
                for (int z = 0; z < i + 5; z++)
                {
                    a[i][z]     = new Marble(true, i, z);
                    a[8 - i][z] = new Marble(true, 8 - i, z);

                    b[i][z]     = new Marble(false, i, z);
                    b[8 - i][z] = new Marble(false, 8 - i, z);
                }
            }
            for (int z = 0; z < 9; z++)
            {
                a[4][z] = new Marble(true, 4, z);
            }
            Board.SetUp(op.boardType, a, b, op.noPlayers);
        }
Ejemplo n.º 2
0
 public override void Init()
 {
     op.Load();
     Board.SetUp(op.boardType, a, b, op.noPlayers);
     op.Save();
 }