Example #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);
            soundCenter = new SoundCenter(this);
            font        = Content.Load <SpriteFont>("MyFont");

            Services.AddService(typeof(SpriteBatch), spriteBatch);
            Services.AddService(typeof(SoundCenter), soundCenter);
            Services.AddService(typeof(SpriteFont), font);

            score = new Score(this);
            Components.Add(score);

            gameOverScene = new GameOverScene(this, score);
            gameOverScene.Hide();

            level2 = new Level2(this, score, gameOverScene, null);
            level1 = new Level1(this, score, gameOverScene, level2);

            Components.Add(level1);
            Components.Add(level2);
            Components.Add(gameOverScene);

            level1.Show();
            level2.Hide();

            curScene = level2;
        }
Example #2
0
 private void Level1_Click(object sender, EventArgs e)
 {
     _form = new Level1();
     ShowForm(_form);
     Close();
 }