public override void Update(GameTime gametime) { KeyboardState pressed = Keyboard.GetState(); if (pressed.IsKeyDown(Keys.A)) { Console.Write(@"pressed"); sceneManager.addScene(destination[0]); } }
protected override void Initialize() { graphics.PreferredBackBufferWidth = 240 * 3; graphics.ApplyChanges(); scenemanager = new SceneManager(Content, graphics.GraphicsDevice); //scenemanager.addScene(new PlaygroundScene(0,0,320,480,Content, graphics.GraphicsDevice)); string[] menuText = { "New Game", "Continue", "Settings", "End Game" }; Scene[] menuDest = new Scene[1]; menuDest[0] = new PlaygroundScene(0, 0, 320, 480, Content, graphics.GraphicsDevice, scenemanager); scenemanager.addScene(new MainMenu(0, 0, 320, 480, Content, graphics.GraphicsDevice, scenemanager, menuText, menuDest)); //add Menu screen here }
protected override void Initialize() { graphics.PreferredBackBufferWidth = 240 * 3; graphics.ApplyChanges(); scenemanager = new SceneManager(Content, graphics.GraphicsDevice); //scenemanager.addScene(new PlaygroundScene(0,0,320,480,Content, graphics.GraphicsDevice)); string[] menuText = {"New Game","Continue","Settings","End Game"}; Scene[] menuDest = new Scene[1]; menuDest[0] = new PlaygroundScene(0,0,320,480,Content, graphics.GraphicsDevice,scenemanager); scenemanager.addScene(new MainMenu(0, 0, 320, 480, Content, graphics.GraphicsDevice,scenemanager,menuText,menuDest)); //add Menu screen here }
protected override void Initialize() { spritebatch = new SpriteBatch(GraphicsDevice); graphics.PreferredBackBufferWidth = 240 * 3; graphics.ApplyChanges(); scenemanager = new SceneManager(Content, graphics.GraphicsDevice); //scenemanager.addScene(new PlaygroundScene(0,0,320,480,Content, graphics.GraphicsDevice)); string[] menuText = { "New Game", "Continue", "Settings", "End Game" }; Scene[] menuDest = new Scene[1]; menuDest[0] = new PlaygroundScene(0, 0, 320, 480, Content, graphics.GraphicsDevice, scenemanager); scenemanager.addScene(new MainMenu(0, 0, 320, 480, Content, graphics.GraphicsDevice, scenemanager, menuText, menuDest)); //add Menu screen here player = new VideoPlayer(); video = Content.Load<Video>("Video/Intro"); //player.Play(video); }
protected override void Initialize() { spritebatch = new SpriteBatch(GraphicsDevice); graphics.PreferredBackBufferWidth = 240 * 3; graphics.ApplyChanges(); scenemanager = new SceneManager(Content, graphics.GraphicsDevice); //scenemanager.addScene(new PlaygroundScene(0,0,320,480,Content, graphics.GraphicsDevice)); string[] menuText = { "New Game", "Continue", "Settings", "End Game" }; Scene[] menuDest = new Scene[1]; menuDest[0] = new PlaygroundScene(0, 0, 320, 480, Content, graphics.GraphicsDevice, scenemanager); scenemanager.addScene(new MainMenu(0, 0, 320, 480, Content, graphics.GraphicsDevice, scenemanager, menuText, menuDest)); //add Menu screen here player = new VideoPlayer(); video = Content.Load <Video>("Video/Intro"); //player.Play(video); }
public override void Update(GameTime gametime) { if (themeSong.State == SoundState.Stopped) { themeSong.Play(); } timer += (float)gametime.ElapsedGameTime.TotalMilliseconds; KeyboardState pressed = Keyboard.GetState(); if (timer > 150f) { timer = 0f; if (pressed.IsKeyDown(Keys.Up)) { selectedindex--; if (selectedindex < 0) { selectedindex = title.Length - 1; } } else if (pressed.IsKeyDown(Keys.Down)) { selectedindex++; if (selectedindex > title.Length - 1) { selectedindex = 0; } } } if (pressed.IsKeyDown(Keys.Enter)) { if (title[selectedindex] == "End Game") { themeSong.Stop(); themeSong.Dispose(); sceneManager.exit = true; } else { themeSong.Stop(); sceneManager.addScene(destination[selectedindex]); } } }
public override void Update(GameTime gametime) { if (themeSong.State == SoundState.Stopped) { themeSong.Play(); } KeyboardState pressed = Keyboard.GetState(); if (pressed.IsKeyUp(Keys.Up) && oldPress.IsKeyDown(Keys.Up)) { selectedindex--; if (selectedindex < 0) { selectedindex = title.Length - 1; } } if (pressed.IsKeyUp(Keys.Down) && oldPress.IsKeyDown(Keys.Down)) { selectedindex++; if (selectedindex > title.Length - 1) { selectedindex = 0; } } if (pressed.IsKeyDown(Keys.Enter)) { if (title[selectedindex] == "End Game") { themeSong.Stop(); themeSong.Dispose(); sceneManager.exit = true; } else { themeSong.Stop(); sceneManager.addScene(destination[selectedindex]); } } oldPress = pressed; }