예제 #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;
            }
        }
예제 #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;
     }
 }
예제 #3
0
 public void HowToPlayEvent(object obj, EventArgs e)
 {
     currentScreen = mainMenu;
 }
예제 #4
0
 public void GameCompleteEvent(object obj, EventArgs e)
 {
     currentScreen = mainMenu;
 }
예제 #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;
        }
예제 #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;
            }
        }
예제 #7
0
 public void OptionsEvent(object obj, EventArgs e)
 {
     currentScreen = mainMenu;
 }