コード例 #1
0
ファイル: MainMenu.cs プロジェクト: Telos8840/CS461
        public override void Update(GameTime gametime)
        {
            KeyboardState pressed = Keyboard.GetState();

            if (pressed.IsKeyDown(Keys.A))
            {
                Console.Write(@"pressed");
                sceneManager.addScene(destination[0]);
            }
        }
コード例 #2
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
 }
コード例 #3
0
ファイル: Game1.cs プロジェクト: Telos8840/TestGame
 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
 }
コード例 #4
0
ファイル: Game1.cs プロジェクト: Commander147/CS461
 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);
 }
コード例 #5
0
ファイル: Game1.cs プロジェクト: jafework/CS461
 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);
 }
コード例 #6
0
        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]);
                }
            }
        }
コード例 #7
0
        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;
        }