示例#1
0
        /// <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()
        {
            // TODO: Add your initialization logic here

            base.Initialize();
            //Initialize The Engine
            //Initialise Le Moteur
            Engine.Initialize(this, graphics);

            //Initialize Character Size
            //Initiaize La Taille Des Personnages
            boy.Initialize(new Vector2(101, 171));
            girl.Initialize(new Vector2(101, 171));
            light.Initialize(new Vector2(101, 171));
            block1.Initialize(new Vector2(101, 171));
            block2.Initialize(new Vector2(101, 171));

            //Initialize Character Position
            //Initiaize La Position Des Personnages
            boy.Position    = new Vector2(200, 200);
            block1.Position = new Vector2(200, 290);
            light.Position  = new Vector2(200, 200);
            girl.Position   = new Vector2(400, 200);
            block2.Position = new Vector2(400, 290);
        }
示例#2
0
        /// <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()
        {
            // TODO: Add your initialization logic here

            base.Initialize();
            //Initialize the engine
            //Initialize Le Moteur
            Chimera.Engine.Initialize(this, graphics);

            //Size Of The Animation
            //Taille de l'animation
            anim.Initialize(new Vector2(64, 64));
            //Display 24 Frame Per second
            //Afficher 24 Image par seconde
            anim.FramesPerSecond = 24;
            //Animation Positon
            //Position de l'animation
            anim.Position = new Vector2(0, 300);
            //Initialize The Scroll Animation
            //Initialise l'animation du defilement
            scroll.Initialize(graphics, anim);
            //Size Of Player
            //Taille Du Joeur
            player.Initialize(new Vector2(35, 77));
            //Player Position
            //Position du joeur
            player.Position = new Vector2(200, 250);
            //Size Of The Floor
            //Taille du sol
            floor.Initialize(new Vector2(1010, 171));
            //Floor Position
            //Position du sol
            floor.Position = new Vector2(0, 200);
            //winrec will have the screen rectangle(X,Y,Width,Height)
            //Winrec aura la le rectangle de l'ecran (X,Y,Largeur,Longeur)
            winrec = Chimera.GUI.MainWindow.Properties.ClientBounds;
            //the backgroud will have the size of screen
            //Le Fond decran aura la taille de lecran
            bg.Initialize(new Vector2(winrec.Width, winrec.Height));
            //Stretch the bg;
            //Redimensioner le fond d'ecran
            bg.Stretch = true;
        }