Esempio n. 1
0
        //När man återvänder från svårighetsgrader startar spelet med vald svårighetsgrad, eller återvänder till huvudmenyn
        public void DifficultyEvent(object obj, EventArgs e)
        {
            sc = (ScreenChoice)e;

            if (sc.choice <= 2)
            {
                play = new Play(this.Content, new EventHandler(PlayEvent), this, gameField, sc.choice);
                currentScreen = play;
            }
            else
            {
                currentScreen = mainMenu;
            }
        }
Esempio n. 2
0
 //Skärm sätts beroende på vilket val man gjorde i huvudmenyn
 public void MainMenuEvent(object obj, EventArgs e)
 {
     sc = (ScreenChoice)e;
     switch (sc.choice)
     {
         case 0:
             currentScreen = difficulty;
             break;
         case 1:
             currentScreen = howToPlay;
             break;
         case 2:
             currentScreen = options;
             break;
         default:
             break;
     }
 }
Esempio n. 3
0
 public void HowToPlayEvent(object obj, EventArgs e)
 {
     currentScreen = mainMenu;
 }
Esempio n. 4
0
 public void GameCompleteEvent(object obj, EventArgs e)
 {
     currentScreen = mainMenu;
 }
Esempio n. 5
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //Skapar nya skärmar
            mainMenu        = new MainMenu(this.Content, new EventHandler(MainMenuEvent), this);
            options         = new Options(this.Content, new EventHandler(OptionsEvent), this, graphics);
            howToPlay       = new HowToPlay(this.Content, new EventHandler(HowToPlayEvent), this);
            difficulty      = new Difficulty(this.Content, new EventHandler(DifficultyEvent), this);
            gameComplete    = new GameComplete(this.Content, new EventHandler(GameCompleteEvent), this);

            //Sätter igång bakgrundsmusiken
            music.Play();

            IsMouseVisible = true;

            currentScreen = mainMenu;
        }
Esempio n. 6
0
        //Antinger går man till huvudmenyn eller så är spelet avklarat
        public void PlayEvent(object obj, EventArgs e)
        {
            sc = (ScreenChoice)e;

            IsMouseVisible = true;

            switch (sc.choice)
            {
                case 0:
                    currentScreen = mainMenu;
                    break;
                case 1:
                    currentScreen = gameComplete;
                    break;
                default:
                    break;
            }
        }
Esempio n. 7
0
 public void OptionsEvent(object obj, EventArgs e)
 {
     currentScreen = mainMenu;
 }