Exemple #1
0
 public MobileSprite(Texture2D texture)
 {
     asSprite = new SpriteAnimation(texture);
 }
Exemple #2
0
        protected void LoadContent()
        {
            MyMap = new TileMap(ParentGame.Content.Load<Texture2D>("TileSets/mousemap"), ParentGame.Content.Load<Texture2D>("TileSets/part9_slopemaps"));
            Tile.TileSetTexture = ParentGame.Content.Load<Texture2D>("TileSets/TileSet");
            Hilight = ParentGame.Content.Load<Texture2D>("TileSets/hilight");
            pericles6 = ParentGame.Content.Load<SpriteFont>("Font/Coord");

            vlad = new SpriteAnimation(ParentGame.Content.Load<Texture2D>("Characters/T_Vlad_Sword_Walking_48x48"));

            vlad.AddAnimation("WalkEast", 0, 48 * 0, 48, 48, 8, 0.1f);
            vlad.AddAnimation("WalkNorth", 0, 48 * 1, 48, 48, 8, 0.1f);
            vlad.AddAnimation("WalkNorthEast", 0, 48 * 2, 48, 48, 8, 0.1f);
            vlad.AddAnimation("WalkNorthWest", 0, 48 * 3, 48, 48, 8, 0.1f);
            vlad.AddAnimation("WalkSouth", 0, 48 * 4, 48, 48, 8, 0.1f);
            vlad.AddAnimation("WalkSouthEast", 0, 48 * 5, 48, 48, 8, 0.1f);
            vlad.AddAnimation("WalkSouthWest", 0, 48 * 6, 48, 48, 8, 0.1f);
            vlad.AddAnimation("WalkWest", 0, 48 * 7, 48, 48, 8, 0.1f);

            vlad.AddAnimation("IdleEast", 0, 48 * 0, 48, 48, 1, 0.2f);
            vlad.AddAnimation("IdleNorth", 0, 48 * 1, 48, 48, 1, 0.2f);
            vlad.AddAnimation("IdleNorthEast", 0, 48 * 2, 48, 48, 1, 0.2f);
            vlad.AddAnimation("IdleNorthWest", 0, 48 * 3, 48, 48, 1, 0.2f);
            vlad.AddAnimation("IdleSouth", 0, 48 * 4, 48, 48, 1, 0.2f);
            vlad.AddAnimation("IdleSouthEast", 0, 48 * 5, 48, 48, 1, 0.2f);
            vlad.AddAnimation("IdleSouthWest", 0, 48 * 6, 48, 48, 1, 0.2f);
            vlad.AddAnimation("IdleWest", 0, 48 * 7, 48, 48, 1, 0.2f);

            vlad.Position = new Vector2(100, 100);
            vlad.DrawOffset = new Vector2(-24, -38);
            vlad.CurrentAnimation = "WalkEast";
            vlad.IsAnimating = true;

            Camera.ViewWidth = Graphics.PreferredBackBufferWidth;
            Camera.ViewHeight = Graphics.PreferredBackBufferHeight;
            Camera.WorldWidth = ((MyMap.MapWidth - 2) * Tile.TileStepX);
            Camera.WorldHeight = ((MyMap.MapHeight - 2) * Tile.TileStepY);
            Camera.DisplayOffset = new Vector2(baseOffsetX, baseOffsetY);
        }