Exemple #1
0
        protected override void LoadContent()
        {
            base.LoadContent();

            Rectangle spriteRect = new Rectangle(0, 0, 36, 36);
            sprite = new LinearSprite(Game.Content.Load<Texture2D>("Images/Ball"), Game1.spriteBatch, spriteRect);
            Rectangle[] rects = new Rectangle[] { new Rectangle(0, 0, spriteRect.Width, spriteRect.Height) };
            idle = new DelayedSpriteStream(new ExplicitSpriteStream(rects, true), 1);

            sprite.updateStream(idle);
        }
Exemple #2
0
        protected override void LoadContent()
        {
            base.LoadContent();

            Rectangle spriteRect = new Rectangle(0, 0, 36, 74);
            sprite = new LinearSprite(Game.Content.Load<Texture2D>("Images/WolfSprite"), Game1.spriteBatch, spriteRect);
            Rectangle[] rects = new Rectangle[] { new Rectangle(0, 0, spriteRect.Width, spriteRect.Height), new Rectangle(spriteRect.Width, 0, spriteRect.Width, spriteRect.Height), new Rectangle(spriteRect.Width*2, 0, spriteRect.Width, spriteRect.Height) };
            run = new DelayedSpriteStream(new ExplicitSpriteStream(rects, true), 2);

            rects = new Rectangle[] { new Rectangle(spriteRect.Width * 3, 0, spriteRect.Width, spriteRect.Height), new Rectangle(spriteRect.Width * 4, 0, spriteRect.Width, spriteRect.Height), new Rectangle(0, spriteRect.Height, spriteRect.Width, spriteRect.Height), new Rectangle(spriteRect.Width, 0, spriteRect.Width, spriteRect.Height) };
             jog = new DelayedSpriteStream(new ExplicitSpriteStream(rects,true),4);
             rects = new Rectangle[] { new Rectangle(spriteRect.Width * 2, spriteRect.Height, spriteRect.Width, spriteRect.Height),
             new Rectangle(spriteRect.Width * 3, 0, spriteRect.Width, spriteRect.Height),
             new Rectangle(spriteRect.Width * 4, spriteRect.Height, spriteRect.Width, spriteRect.Height),
             new Rectangle(0, spriteRect.Height*2, spriteRect.Width, spriteRect.Height) ,
             new Rectangle(spriteRect.Width, spriteRect.Height*2, spriteRect.Width, spriteRect.Height) ,
             new Rectangle(spriteRect.Width * 2, spriteRect.Height*2, spriteRect.Width, spriteRect.Height) ,
             new Rectangle(spriteRect.Width * 3, spriteRect.Height*2, spriteRect.Width, spriteRect.Height) ,
             new Rectangle(spriteRect.Width * 4, spriteRect.Height*2, spriteRect.Width, spriteRect.Height)
             };
             walk = new DelayedSpriteStream(new ExplicitSpriteStream(rects, true), 8);
             rects = new Rectangle[] {  new Rectangle(spriteRect.Width * 2, spriteRect.Height, spriteRect.Width, spriteRect.Height)
             };
             idle = new DelayedSpriteStream(new ExplicitSpriteStream(rects, true), 8);
            sprite.updateStream(idle);

            destRect = new Rectangle(0, 0, 36, 72);
        }