(function() { "use strict"; var Rain = function(levelData) { this.initialize(levelData); } var p = Rain.prototype = new createjs.Container(); p.Container_initialize = p.initialize; p.initialize = function(levelData) { this.Container_initialize(); DragComponent.add(this); MoveComponent.add(this); this.sprite = new createjs.Bitmap(loader.getResult('img_levelRain')); this.dragFriction = CONST.RAIN_FRICTION; this.dragAllowY = false; this.moveDirX = 1; this.moveSpeed = 50; this.visible = false; var bounds = this.sprite.getBounds(); this.regX = bounds.width/2; this.regY = bounds.height/2; this.x = levelData.rainPosition[0]; this.y = levelData.rainPosition[1]; this.shape = new createjs.Shape(); this.shape.alpha = 0.3 this.shape.graphics.beginFill('#333'); this.shape.graphics.drawRect(0, bounds.height-30, bounds.width, (500-this.x*levelData.scale)); this.addChild(this.shape); this.addChild(this.sprite); } p.globalToLocal = function(x, y) { return this.sprite.globalToLocal(x, y); } p.hitTest = function(x, y) { return this.sprite.hitTest(x, y); } window.Rain = Rain; }());