示例#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);
            EntityManager.m_spriteBatch = spriteBatch;

            // Loading the Player into the Entity Manager
            Player player = new Player("Cro", new Vector2(300, 300), this.Content);

            EntityManager.Instance.AddEntity(player);

            // Loading Enemy character into Entity Manager
            PterEnemy pter01 = new PterEnemy("Pter01", new Vector2(500, 300), this.Content);

            EntityManager.Instance.AddEntity(pter01);

            // TODO: use this.Content to load your game content here
            EntityManager.Instance.LoadContentForAllEntities(this.Content);

            //Screen
            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
            //graphics.IsFullScreen = true;
            graphics.ApplyChanges();
            IsMouseVisible = true;

            buttonPlay = new Button(Content.Load <Texture2D>("Buttons/Start"), graphics.GraphicsDevice);
            buttonPlay.setPosition(new Vector2(350, 300));

            buttonOptions = new Button(Content.Load <Texture2D>("Buttons/Options"), graphics.GraphicsDevice);
            buttonOptions.setPosition(new Vector2(350, 400));

            buttonCredits = new Button(Content.Load <Texture2D>("Buttons/Credits"), graphics.GraphicsDevice);
            buttonCredits.setPosition(new Vector2(350, 500));

            buttonBack = new Button(Content.Load <Texture2D>("Buttons/Back"), graphics.GraphicsDevice);
            buttonBack.setPosition(new Vector2(50, 100));

            buttonBack2 = new Button(Content.Load <Texture2D>("Buttons/Back2"), graphics.GraphicsDevice);
            buttonBack2.setPosition(new Vector2(50, 100));
        }
        /// <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);
            EntityManager.m_spriteBatch = spriteBatch;

            // Loading the Player into the Entity Manager
            Player player = new Player("Cro", new Vector2(300, 300), this.Content);
            EntityManager.Instance.AddEntity(player);

            // Loading Enemy character into Entity Manager
            PterEnemy pter01 = new PterEnemy("Pter01", new Vector2(500, 300), this.Content);
            EntityManager.Instance.AddEntity(pter01);

            // TODO: use this.Content to load your game content here
            EntityManager.Instance.LoadContentForAllEntities(this.Content);

            //Screen
            graphics.PreferredBackBufferWidth = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;
            //graphics.IsFullScreen = true;
            graphics.ApplyChanges();
            IsMouseVisible = true;

            buttonPlay = new Button(Content.Load<Texture2D>("Buttons/Start"), graphics.GraphicsDevice);
            buttonPlay.setPosition(new Vector2(350, 300));

            buttonOptions = new Button(Content.Load<Texture2D>("Buttons/Options"), graphics.GraphicsDevice);
            buttonOptions.setPosition(new Vector2(350, 400));

            buttonCredits = new Button(Content.Load<Texture2D>("Buttons/Credits"), graphics.GraphicsDevice);
            buttonCredits.setPosition(new Vector2(350, 500));

            buttonBack = new Button(Content.Load<Texture2D>("Buttons/Back"), graphics.GraphicsDevice);
            buttonBack.setPosition(new Vector2(50, 100));

            buttonBack2 = new Button(Content.Load<Texture2D>("Buttons/Back2"), graphics.GraphicsDevice);
            buttonBack2.setPosition(new Vector2(50, 100));
        }