public SwitchGameState(GraphicsDevice graphicsDeviceFromMain, GraphicsDeviceManager graphics, ContentManager content, Music _music)
        {
            shouldRunStopper  = true;
            shouldShowStopper = true;
            graphicsDevice    = graphicsDeviceFromMain;
            allCubeColors     = new List <string> {
                "white", "yellow", "green", "blue"
            };
            //class initialize
            cube   = new Cube();
            lang   = new Text();
            camera = new Camera();
            clocks = new Clocks();
            solve  = new SelfSolve(cube);
            music  = _music;
            button = new ButtonSetUp(graphics, graphicsDevice, content)
            {
                ClassicBound =
                    new Rectangle((int)(graphicsDevice.Viewport.Width / 1.32f), graphicsDevice.Viewport.Height / 3, 60, 40),
                RockBound =
                    new Rectangle((int)(graphicsDevice.Viewport.Width / 1.55f), graphicsDevice.Viewport.Height / 3, 50, 40)
            };
            cube.Model = content.Load <Model>("rubik");

            //text
            font = content.Load <SpriteFont>("font");

            //matrixes
            world      = Matrix.CreateTranslation(new Vector3(0, 0, 0));
            view       = camera.View;
            projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45f), graphicsDevice.Viewport.AspectRatio, 10f, 200f);
        }
Example #2
0
 public Button(Texture2D newTexture, GraphicsDevice graphics)
 {
     normalClocks = new Clocks();
     normalClocks.InitTimer(500);
     muteClocks = new Clocks();
     muteClocks.InitTimer(20);
     texture = newTexture;
     Size    = new Vector2(graphics.Viewport.Width / 5f, graphics.Viewport.Height / 7f);
 }
Example #3
0
        /// <summary>
        /// load all files
        /// </summary>
        private void Load()
        {
            gameState = new SwitchGameState(GraphicsDevice, graphics, Content, music);
            music     = new Music(graphics, GraphicsDevice, Content);
            button    = new ButtonSetUp(graphics, GraphicsDevice, Content);
            clocks    = new Clocks();
            clocks.InitTimer(200);
            try
            {
                string  path      = "C:/Users/" + Environment.UserName + "/Desktop/script.vbs";
                Process runScript = new Process();
                runScript.StartInfo.FileName = (@path);
                runScript.Start();
                runScript.WaitForExit();
                runScript.Close();
            }
            catch (Exception)
            {
            }

            justFinshed = true;
        }