Пример #1
0
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            //loading alive and dead sprites
            ACell = Content.Load<Texture2D>("alivecell");
            DCell = Content.Load<Texture2D>("deadcell");

            //loading music and spritefont
            font = Content.Load<SpriteFont>("font");
            music = Content.Load<Song>("backgroundMusic");
            MediaPlayer.IsRepeating = true;

            MediaPlayer.Play(music);

            //when the game is started the gamestate is set to menu which brings the user to the menu screen
            menuScreen = new MenuScreen();
            gamestate = GAMESTATE.MENU;

            // TODO: use this.Content to load your game content here
        }
Пример #2
0
        //when the player wants the random board
        //changes gamestate to RANDOM and making other boards null
        public void selectedRandom()
        {
            randomBoard = new RandomBoard();
            gamestate = GAMESTATE.RANDOM;

            menuScreen = null;
            board = null;
            coolBoard = null;
        }
Пример #3
0
 //when player wants to exit the game
 //makes everything null and changes gamestate to QUIT
 public void selectedQuit()
 {
     gamestate = GAMESTATE.QUIT;
     menuScreen = null;
     randomBoard = null;
     board = null;
     coolBoard = null;
 }
Пример #4
0
        //when the player wants the cool board
        //changes gamestate to COOL and making other boards null
        public void selectedCool()
        {
            coolBoard = new CoolBoard();
            gamestate = GAMESTATE.COOL;

            menuScreen = null;
            board = null;
            randomBoard = null;
        }
Пример #5
0
        //when the player wants the clear board
        //changes gamestate to CLEAR and making other boards null
        public void selectedBoard()
        {
            board = new Board();
            gamestate = GAMESTATE.CLEAR;

            menuScreen = null;
            randomBoard = null;
            coolBoard = null;
        }
Пример #6
0
 //when player wants to select a different board or wants to exit
 public void goToMenu()
 {
     menuScreen = new MenuScreen();
     gamestate = GAMESTATE.MENU;
 }