public object Clone() { Animation animationClone = new Animation(this); animationClone.FrameWidth = FrameWidth; animationClone.FrameHeight = FrameHeight; animationClone.Reset(); return animationClone; }
private Animation(Animation animation) { frames = animation.frames; FramesPerSecond = 5; }
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)); }