JavaScript

				    
(function () {
		
    var game, slice;
	
    // Create a game
    game = BLOCKS.game();
	
    // Create an example slice
    slice = BLOCKS.slice({
        layer: BLOCKS.layer(game.element), // Create a new canvas for the slice
        imageSrc: "images/coin.png", // Define sprite sheet location
        numberOfFrames: 10, // Define number of frames of animation
        loop: true
    });
	
    // Notify the slice of game loop
    game.update = slice.update;			
    game.render = slice.render;

} ());
		    	

Image

Slice Image

Demo