(function() { "use strict"; var Bullet = function(data) { this.initialize(data); } var p = Bullet.prototype = new createjs.Bitmap(); p.area = null; p.speed = null; p.damage = null; p.mindepth = null; p.maxdepth = null; p.Bitmap_initialize = p.initialize; p.initialize = function(data) { this.Bitmap_initialize(loader.getResult(data.id)); this.regX = this.image.width/2; this.regY = this.image.height/2; this.area = data.area; this.speed = data.speed; this.damage = data.damage; this.mindepth = data.mindepth; this.maxdepth = data.maxdepth; } p.move = function(fdelta) { if (this.maxdepth && this.y > this.maxdepth) return; this.y += this.speed*fdelta; } window.Bullet = Bullet; }());