示例#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()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Mario            = new Gameobject2();
            Mario.estvivant  = true;
            Mario.position.X = 50;
            Mario.position.Y = 900;
            //Ennemi
            Ennemi            = new Gameobject2();
            Ennemi.estvivant  = true;
            Ennemi.position.X = fenetre.Top;
            Ennemi.position.Y = fenetre.Top;
            //Projectiles
            projectile           = new Gameobject2();
            projectile.estvivant = true;
            projectile.position  = Ennemi.position;
            //Mario
            projectilemario           = new Gameobject2();
            projectilemario.estvivant = false;
            //Explosions
            explosion            = new Gameobject2();
            explosion.estvivant  = true;
            explosion1           = new Gameobject2();
            explosion1.estvivant = true;
            //Sons
            SoundEffect         son;
            SoundEffectInstance sonlaser;



            //Ajouter l'image.
            //**** Aller dans advences et cliquer sur copy to output et copy if newer
            Mario.sprite           = Content.Load <Texture2D>("spaceship1.png");
            projectile.sprite      = Content.Load <Texture2D>("projectile1.png");
            Ennemi.sprite          = Content.Load <Texture2D>("ennemi1.png");
            background             = Content.Load <Texture2D>("Background.png");
            explosion.sprite       = Content.Load <Texture2D>("explosion2.png");
            explosion1.sprite      = Content.Load <Texture2D>("explosion1.png");
            projectilemario.sprite = Content.Load <Texture2D>("Projectilemario4.png");
            son      = Content.Load <SoundEffect>("Sons\\Laser");
            sonlaser = son.CreateInstance();



            //Charger un son chanson, il faut changer le type avec le nom entre guillemet.


            // TODO: use this.Content to load your game content here
        }