private Animation(Animation animation) { this.frames = animation.frames; FramesPerSecond = 5; }
protected void createPlayer() { Texture2D spriteSheet = Game.Content.Load<Texture2D>(@"PlayerSprites\char4"); Dictionary<AnimationKey, Animation> animations = new Dictionary<AnimationKey, Animation>(); Animation animation = new Animation(3, 50, 50, 0, 0); animations.Add(AnimationKey.Down, animation); animation = new Animation(3, 50, 50, 0, 50); animations.Add(AnimationKey.Up, animation); animation = new Animation(3, 50, 50, 0, 100); animations.Add(AnimationKey.Right, animation); animation = new Animation(3, 50, 50, 0, 150); animations.Add(AnimationKey.Left, animation); Vector2 start = new Vector2(3 * Engine.TileHeight, 3 * Engine.TileWidth); AnimatedSprite sprite = new AnimatedSprite(spriteSheet, animations,start); 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; }