Пример #1
0
        public Game1()
            : base()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            GameStatus = GameState.Playing;

            //Services
            input = new InputHandler(this);
            this.Components.Add(input);

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

            /** adds paddles */
            redPaddle  = new Paddle(this, TeamColor.Red);
            bluePaddle = new Paddle(this, TeamColor.Blue);
            this.Components.Add(bluePaddle);
            this.Components.Add(redPaddle);
            Paddle[] pads = new Paddle[] { bluePaddle, redPaddle };

            /** adds BallManager */
            balls = new BallManager(this, pads);
            this.Components.Add(balls);

            im = new ItemManager(this, pads);
            this.Components.Add(im);

            bm = new BlockManager(this, balls, im);
            this.Components.Add(bm);
        }
Пример #2
0
 /// <summary>
 /// BlockManager hold a list of blocks and handles updating, drawing a block collision
 /// </summary>
 /// <param name="game">Reference to Game</param>
 /// <param name="ball">Refernce to Ball for collision</param>
 public BlockManager(Game game, BallManager b, ItemManager im)
     : base(game)
 {
     this.Blocks      = new List <Block>();
     caseQueue        = new Queue <int>();
     this.ballManager = b;
     this.itemManager = im;
 }