Plato on Github
Report Home
src/animation.js
Maintainability
124.11
Lines of code
52
Difficulty
15.47
Estimated Errors
0.31
Function weight
By Complexity
By SLOC
define('lyria/animation', ['jquery', 'mixer', 'eventmap'], function($, mixer, EventMap) { var Animation = (function() { var Animation = function($elem, options) { this.$elem = $elem; var defaultOptions = { frame: { width: 0, height: 0, current: 0 }, speed: 1 }; options = $.extend(true, defaultOptions, options); this.frame = {}; this.frame.width = options.frame.width; this.frame.height = options.frame.height; this.frame.current = options.frame.current; this.speed = options.speed; this.sprite = {}; this.sprite.width; this.sprite.height; this.sprite.image = new Image(); // Mix-in eventmap mixer([this, Animation.prototype], new EventMap()); this.on('play', function() { }); this.on('pause', function() { }); this.on('reset', function() { }); this.on('stop', function() { }); }; return Animation; })(); return Animation; });