コード例 #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            startScreen = new StartScreen(this, spriteBatch, Content.Load<SpriteFont>("menufont"),
                                          Content.Load<Texture2D>("GameScreen/ActiveArtillery"));
            Components.Add(startScreen);
            startScreen.Hide();

            actionScreen = new ActionScreen(this, spriteBatch, viewPort);
            actionScreen.LoadAction();
            Components.Add(actionScreen);
            actionScreen.Hide();

            ynScreen = new AreYouSure(this, spriteBatch, Content.Load<SpriteFont>("menufont"),
                                      Content.Load<Texture2D>("GameScreen/CoastGun"));
            Components.Add(ynScreen);
            ynScreen.Hide();

            activeScreen = startScreen;
            activeScreen.Show();
        }
コード例 #2
0
 private void HandleStartScreen()
 {
     if (CheckKey(Keys.Enter))
     {
         if (startScreen.SelectedIndex == 0)
         {
             activeScreen.Hide();
             activeScreen = actionScreen;
             activeScreen.Show();
         }
         if (startScreen.SelectedIndex > 1)
         {
             this.Exit();
         }
     }
 }
コード例 #3
0
 private void HandleYNScreen()
 {
     //Console.WriteLine("Index: "+ ynScreen.SelectedIndex);
     if (CheckKey(Keys.Enter))
     {
         if (ynScreen.SelectedIndex == 0)
         {
             activeScreen.Hide();
             activeScreen = actionScreen;
             activeScreen.Hide();
             activeScreen = startScreen;
             activeScreen.Show();
         }
         if (ynScreen.SelectedIndex == 1)
         {
             activeScreen.Hide();
             activeScreen = actionScreen;
             activeScreen.Show();
         }
     }
 }
コード例 #4
0
 private void HandleActionScreen()
 {
     if (CheckKey(Keys.Escape))
     {
         activeScreen.Enabled = false;
         activeScreen = ynScreen;
         activeScreen.Show();
     }
 }