# Syntax for animations

**URL:** <https://phaser.discourse.group/t/syntax-for-animations/7262>\
**Category:** Phaser 3\
**Created:** [August 24, 2020, 7:21pm UTC](https://phaser.discourse.group/t/syntax-for-animations/7262 "2020-08-24T19:21:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![3b33](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/3b33/32/3334_2.png) [@3b33](https://phaser.discourse.group/u/3b33)\
**Post date:** [August 24, 2020, 7:21pm UTC](https://phaser.discourse.group/t/syntax-for-animations/7262/1 "2020-08-24T19:21:46Z")

</div>

I’m learning how to use Colbydude’s palette swapping example and I want to combine what is already being used in the config with this.anims.generateFrameNumbers but I’m not sure how to go about doing that.

Original:  
var animConfig = {  
paletteKey: ‘link-palette’, // Palette file we’re referencing.  
paletteNames: [‘green’, ‘red’, ‘blue’, ‘purple’], // Names for each palette to build out the names for the atlas.  
spriteSheet: { // Spritesheet we’re manipulating.  
key: ‘link’,  
frameWidth: 32,  
frameHeight: 32  
},  
animations: [ // Animation data.  
{key: ‘walk-down’, frameRate: 15, startFrame: 0, endFrame: 9},  
{key: ‘walk-left’, frameRate: 15, startFrame: 10, endFrame: 19},  
{key: ‘walk-up’, frameRate: 15, startFrame: 20, endFrame: 29}  
]  
};

For example, I might want to replace walk-down key with this way:

```
		this.anims.create({
			key: 'walk-down',
			frames: this.anims.generateFrameNumbers('link-palette', { frames: [0,1,2,3,4,5] }), 
			frameRate: 15,
			repeat: 0
    		});
```

---

<div class="post-metadata">

**Author:** ![3b33](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/3b33/32/3334_2.png) [@3b33](https://phaser.discourse.group/u/3b33)\
**Post date:** [August 28, 2020, 11:19pm UTC](https://phaser.discourse.group/t/syntax-for-animations/7262/2 "2020-08-28T23:19:53Z")

</div>

I think I’m going to have to redo my spritesheet so I can use the startFrame & endFrame method rather than jumping around the spritesheet to use desired frame order.
