private void afterLoadingStart(GraphicsDevice GraphicsDevice, GraphicsDeviceManager graphics, ContentManager Content) { cube = new Cube(); gameState = new SwitchGameState(GraphicsDevice, graphics, Content); music = new Music(graphics, GraphicsDevice, Content); button = new ButtonSetUp(graphics, GraphicsDevice, Content); }
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); }
//private bool isFirstTimeRock = true; //private bool isFirstTimeClassic = true; public Music(GraphicsDeviceManager graphics, GraphicsDevice graphicsDevice, ContentManager Content) { whichGenre = "default"; defaultSong = Content.Load <Song>("music/bg-music"); //MediaPlayer.Play(defaultSong); button = new ButtonSetUp(graphics, graphicsDevice, Content); }
//private bool isFirstTimeRock = true; //private bool isFirstTimeClassic = true; public Music(GraphicsDeviceManager graphics, GraphicsDevice graphicsDevice, ContentManager Content) { whichGenre = "default"; defaultSong = Content.Load<Song>("music/bg-music"); //MediaPlayer.Play(defaultSong); button = new ButtonSetUp(graphics, graphicsDevice, Content); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { this.IsMouseVisible = true; Window.AllowUserResizing = true; this.IsFixedTimeStep = false; cube = new Cube(); gameState = new SwitchGameState(GraphicsDevice, graphics, Content); music = new Music(graphics, GraphicsDevice, Content); button = new ButtonSetUp(graphics, GraphicsDevice, Content); base.Initialize(); }
public SwitchGameState(GraphicsDevice GraphicsDevice, GraphicsDeviceManager graphics, ContentManager Content) { lang = new Text(); cube = new Cube(); button = new ButtonSetUp(graphics, GraphicsDevice, Content); music = new Music(graphics, GraphicsDevice, Content); button.ClassicBound = new Rectangle((int)(GraphicsDevice.Viewport.Width / 1.32f), GraphicsDevice.Viewport.Height / 3, 60, 40); button.RockBound = new Rectangle((int)(GraphicsDevice.Viewport.Width / 1.55f), GraphicsDevice.Viewport.Height / 3, 50, 40); cube.Model = Content.Load<Model>("rubik"); text = Content.Load<SpriteFont>("font"); world = Matrix.CreateTranslation(new Vector3(0, 0, 0)); view = Matrix.CreateLookAt(new Vector3(20, 20, 20), new Vector3(0, 0, 0), Vector3.Up); projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45f), GraphicsDevice.Viewport.AspectRatio, 10f, 200f); }
public SwitchGameState(GraphicsDevice GraphicsDevice, GraphicsDeviceManager graphics, ContentManager Content) { lang = new Text(); cube = new Cube(); button = new ButtonSetUp(graphics, GraphicsDevice, Content); music = new Music(graphics, GraphicsDevice, Content); button.ClassicBound = new Rectangle((int)(GraphicsDevice.Viewport.Width / 1.32f), GraphicsDevice.Viewport.Height / 3, 60, 40); button.RockBound = new Rectangle((int)(GraphicsDevice.Viewport.Width / 1.55f), GraphicsDevice.Viewport.Height / 3, 50, 40); cube.Model = Content.Load <Model>("rubik"); text = Content.Load <SpriteFont>("font"); world = Matrix.CreateTranslation(new Vector3(0, 0, 0)); view = Matrix.CreateLookAt(new Vector3(20, 20, 20), new Vector3(0, 0, 0), Vector3.Up); projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45f), GraphicsDevice.Viewport.AspectRatio, 10f, 200f); }
/// <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; }
public SwitchGameState(GraphicsDevice graphicsDevice, GraphicsDeviceManager graphics, ContentManager content) { //class initialize cube = new Cube(); lang = new Text(); camera = new Camera(); 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); }
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); }
/// <summary> /// load all files /// </summary> private void Load() { gameState = new SwitchGameState(GraphicsDevice, graphics, Content); music = new Music(graphics, GraphicsDevice, Content); button = new ButtonSetUp(graphics, GraphicsDevice, Content); popup = new FirstPopup(gameState); timer = new Timer(200); save = new SaveGame("..\\..\\..\\save.xml", "root"); justFinshed = true; }
/// <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; }