Esempio n. 1
0
        public Level(Game game, Score score, Scene gameOverScene, Level nextLevel)
            : base(game)
        {
            this.game = game;
            spriteBatch = (SpriteBatch)game.Services.GetService(typeof(SpriteBatch));
            soundCenter = (SoundCenter)game.Services.GetService(typeof(SoundCenter));
            font = (SpriteFont)game.Services.GetService(typeof(SpriteFont));

            bg = new Background(game);
            paddle = new Paddle(game);
            ball = new Ball(game);
            this.score = score;
            this.gameOverScene = gameOverScene;
            this.nextLevel = nextLevel;

            SceneComponents.Add(bg);
            SceneComponents.Add(paddle);
            SceneComponents.Add(ball);
            SceneComponents.Add(this.score);

            // pause paddle and ball until start
            paddle.Enabled = false;
            ball.Enabled = false;

            bricks = new List<Brick>();

            CreateBricks();
        }
Esempio n. 2
0
 public Level2(Game game, Score score, Scene gameOverScene, Level nextLevel)
     : base(game, score, gameOverScene, nextLevel)
 {
 }