コード例 #1
0
ファイル: Game1.cs プロジェクト: faudeval/projet
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            Globals.largeurFenetre = Window.ClientBounds.Width;
            Globals.hauteurFenetre = Window.ClientBounds.Height;
            Globals.Random         = new Random();
            Globals.IsAgainstIA    = false;
            //Construction des sprites
            b1      = new Balle(1);
            b2      = new Balle(2);
            j1      = new Raquette(1);
            j2      = new Raquette(2);
            briques = new List <Brique>();
            for (int i = 0; i < nbBriques; i++)
            {
                briques.Add(new Brique());
            }
            //Initialisation des sprites
            b1.Initialize();
            b2.Initialize();
            j1.Initialize();
            j2.Initialize();
            foreach (Brique brique in briques)
            {
                brique.Initialize();
            }

            //Initialisation du jeu
            base.Initialize();
        }