Пример #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);

            blockTexture1 = Content.Load<Texture2D>("Textures/block");
            blockTexture2 = Content.Load<Texture2D>("Textures/block2");

            idleTexture = Content.Load<Texture2D>("Textures/idle");
            runTexture = Content.Load<Texture2D>("Textures/run");
            jumpTexture = Content.Load<Texture2D>("Textures/jump");

            Rectangle rect = new Rectangle(0, Height - idleTexture.Height - 40, 60, 60);
            hero = new AnimatedSprite(rect, idleTexture, runTexture, jumpTexture, this);

            CreateLevel();
            // TODO: use this.Content to load your game content here
        }
Пример #2
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);

            hudFont = Content.Load<SpriteFont>("Fonts/Hud");

            blockTexture1 = Content.Load<Texture2D>("Textures/rock");
            blockTexture2 = Content.Load<Texture2D>("Textures/bricks");

            jumpTexture = Content.Load<Texture2D>("Textures/j-jump");
            idleTexture = Content.Load<Texture2D>("Textures/j-Idle");
            runTexture = Content.Load<Texture2D>("Textures/j-active");
            digTexture = Content.Load<Texture2D>("Textures/j-digging-2");
            Rectangle rect = new Rectangle(0, Height - idleTexture.Height - 40, 55, 77);
            hero = new AnimatedSprite(rect, idleTexture, runTexture, digTexture, jumpTexture ,this);

            CreateLevel();
            // TODO: use this.Content to load your game content here
        }