public 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, 96); animations.Add(AnimationKey.Up, 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); AnimatedSprite sprite = new AnimatedSprite(gameRef.Content.Load<Texture2D>(@"GUI\malefighter"), animations); GamePlayScreen.Player = new Player(gameRef, sprite); }
public 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, 96); animations.Add(AnimationKey.Up, 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); AnimatedSprite sprite = new AnimatedSprite(characterImages[genderSelector.SelectedIndex, classSelector.SelectedIndex], animations); GamePlayScreen.Player = new Player(gameRef, sprite); }
public object Clone() { Animation animationClone = new Animation(this); animationClone.frameWidth = this.frameWidth; animationClone.frameHeight = this.frameHeight; animationClone.Reset(); return animationClone; }
private Animation(Animation animation) { this.frames = animation.frames; framesPerSecond = 5; }