Exemple #1
0
        public void LockToSprite(AnimatedSprite sprite)
        {
            position.X = (sprite.Position.X + sprite.Width * 0.5f) * Zoom - ViewportRectangle.Width * 0.5f;
            position.Y = (sprite.Position.Y + sprite.Height * 0.5f) * Zoom - ViewportRectangle.Height * 0.5f;

            LockCamera();
        }
        private void CreatePlayer()
        {
            Dictionary<AnimationKey, Animation> animations = new Dictionary<AnimationKey, Animation>();

            Animation animation = new Animation(3, 32, 32, 0, 0);
            animations.Add(AnimationKey.Down, animation);

            animation = new Animation(3, 32, 32, 0, 32);
            animations.Add(AnimationKey.Left, animation);

            animation = new Animation(3, 32, 32, 0, 64);
            animations.Add(AnimationKey.Right, animation);

            animation = new Animation(3, 32, 32, 0, 96);
            animations.Add(AnimationKey.Up, animation);

            AnimatedSprite sprite = new AnimatedSprite(
                characterImages[genderSelector.SelectedIndex, classSelector.SelectedIndex],
                animations);

            Entity entity = new Entity("Encelwyn", DataManager.EntityData[SelectedClass], (EntityGender)Enum.Parse(typeof(EntityGender), SelectedGender), EntityType.Character);

            foreach (string s in DataManager.SkillData.Keys)
            {
                Skill skill = Skill.SkillFromSkillData(DataManager.SkillData[s]);
                entity.Skills.Add(s, skill);
            }

            GamePlayScreen.Player = new Player(new Character(entity, sprite));
        }
Exemple #3
0
 public Character(Entity entity, AnimatedSprite sprite)
 {
     Entity = entity;
     Sprite = sprite;
 }
 public NonPlayerCharacter(Entity entity, AnimatedSprite sprite)
     : base(entity, sprite)
 {
     Conversations = new List<Conversation>();
     Quests = new List<Quest>();
 }