Sprite Animations

To add animations to a sprite, first place a multi-frame sprite on the map and set the dimensions of an individual frame. 

Then, in the source editor:

"use strict";
window.SpriteAnimations.state.menu = {
    create: function() {
        this.character = mt.create("character"); //initialize the game object
        this.character.animations.add("run", [6, 7, 8, 9, 10, 11], 10, true); //add animation(key, array of frames, FPS, loop)
        this.character.animations.play("run"); //play animation when the game is started (key)
    },

    update: function() {

    }
};


Try to add the other animations here.

Leave a Reply

Your email address will not be published. Required fields are marked *