Exemplo n.º 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);
            tile.TileSetTexture = Content.Load<Texture2D>("Textures/Tilesets/tileset");
            Arial6 = Content.Load<SpriteFont>("Fonts/Arial6");
            Arial12 = Content.Load<SpriteFont>("Fonts/Arial12");
            map = new Map(Content.Load<Texture2D>("Textures/Tilesets/mousemap"));
            Camera.WorldWidth = ((map.MapWidth - 2) * Tile.StepX);
            Camera.WorldHeight = ((map.MapHeight - 2) * Tile.StepY);
            highlight = Content.Load<Texture2D>("Textures/Tilesets/highlight");
            border = Content.Load<Texture2D>("Textures/Tilesets/border");
            debugHUD = new Texture2D(GraphicsDevice, 1, 1);
            debugHUD.SetData(new Color[] { Color.White });


            //Vlad to separate class or character class with common methods
            vlad = new Character(Content.Load<Texture2D>("Textures/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(180, 160);
            vlad.DrawOffset = new Vector2(-24, -38);
            vlad.CurrentAnimation = "WalkEast";
            vlad.IsAnimating = true;
        }
Exemplo n.º 2
0
 public MobileSprite(Texture2D texture)
 {
     asSprite = new Character(texture);
 }