Ejemplo n.º 1
0
        public void Initialize(ContentManager contentManager)
        {
            Map = new Map();
            Objects = new Map();

            Player = new MainCharacter(Map);
            //Player.Position = MainCharacter.GetCenter();
            Player.setPosition(new Vector2(580, 528));
            //Console.Out.WriteLine("Player pos: " + Player.Position.X + ", Y: " + Player.Position.Y);
            Player.SetAnimation(Properties.MainCharacterWidth, Properties.MainCharacterHeight);
            Player.AddAnimation("walkDown", new int[] { 1, 2 }, 4);
            Player.AddAnimation("walkUp", new int[] { 4, 5 }, 4);
            Player.AddAnimation("walkLeft", new int[] { 7, 8 }, 5);
            Player.AddAnimation("walkRight", new int[] { 10, 11 }, 5);

            DrawableMonster monster = new DrawableMonster();
            monster.LoadContent(contentManager, "tree");
            monster.Position.X = 808;
            monster.Position.Y = 746;
            Monsters.Add(monster);

            Texture2D fireball = contentManager.Load<Texture2D>("fireball");

            Follow.LoadContent(contentManager, "fire");
            Follow.AddTexture(fireball);
            Follow.Position.X = 580;
            Follow.Position.Y = 578;
        }
Ejemplo n.º 2
0
 public MainCharacter(Map map)
 {
     this.Map = map;
     Status = PlayerStatus.Standing;
     Position = new Vector2(2000, 500);
 }