addAnimation(name, index, animationspeed) {
		this.anim[name] = {
			name: name,
			frames: [],
			idx: 0,
			length: 0,
		};

		// # of frames
		let counter = 0;

		if (typeof this.textureAtlas !== "object") {
			return 0;
		}

		if (index == null) {
			index = [];
			// create a default animation with all frame
			Object.keys(this.textureAtlas).forEach((v, i) => {
				index[i] = i;
			});
		}

		// set each frame configuration (offset, size, etc..)
		for (let i = 0, len = index.length; i < len; i++) {
			const frame = index[i];
			let frameObject;
			if (typeof frame === "number" || typeof frame === "string") {
				frameObject = {
					name: frame,
					delay: animationspeed || this.animationspeed,
				};
			} else {
				frameObject = frame;
			}
			const frameObjectName = frameObject.name;
			if (typeof frameObjectName === "number") {
				if (typeof this.textureAtlas[frameObjectName] !== "undefined") {
					// TODO: adding the cache source coordinates add undefined entries in webGL mode
					this.anim[name].frames[i] = Object.assign(
						{},
						this.textureAtlas[frameObjectName],
						frameObject,
					);
					counter++;
				}
			} else {
				// string
				if (this.source.getFormat().includes("Spritesheet")) {
					throw new Error(
						"string parameters for addAnimation are not allowed for standard spritesheet based Texture",
					);
				} else {
					this.anim[name].frames[i] = Object.assign(
						{},
						this.textureAtlas[this.atlasIndices[frameObjectName]],
						frameObject,
					);
					counter++;
				}
			}
		}
		this.anim[name].length = counter;

		return counter;
	}
add an animation <br>
For fixed-sized cell sprite sheet, the index list must follow the
logic as per the following example :<br>
<img src="images/spritesheet_grid.png"/>
@param {string} name - animation id
@param {number[]|string[]|object[]} index - list of sprite index or name defining the animation. Can also use objects to specify delay for each frame, see below
@param {number} [animationspeed] - cycling speed for animation in ms
@returns {number} frame amount of frame added to the animation (delay between each frame).
@see Sprite#animationspeed
@example
// walking animation
this.addAnimation("walk", [ 0, 1, 2, 3, 4, 5 ]);
// standing animation
this.addAnimation("stand", [ 11, 12 ]);
// eating animation
this.addAnimation("eat", [ 6, 6 ]);
// rolling animation
this.addAnimation("roll", [ 7, 8, 9, 10 ]);
// slower animation
this.addAnimation("roll", [ 7, 8, 9, 10 ], 200);
// or get more specific with delay for each frame. Good solution instead of repeating:
this.addAnimation("turn", [{ name: 0, delay: 200 }, { name: 1, delay: 100 }])
// can do this with atlas values as well:
this.addAnimation("turn", [{ name: "turnone", delay: 200 }, { name: "turntwo", delay: 100 }])
// define an dying animation that stop on the last frame
this.addAnimation("die", [{ name: 3, delay: 200 }, { name: 4, delay: 100 }, { name: 5, delay: Infinity }])
// set the standing animation as default
this.setCurrentAnimation("stand");