(function() { "use strict"; var CooldownBar = function() { this.initialize(); } var p = CooldownBar.prototype = new creatine.ProgressBar(); p.ProgressBar_initialize = p.initialize; p.initialize = function() { var colors = ['#FDE516', // '#F9B514', '#FC871D', '#F73100', '#B20000']; this.ProgressBar_initialize( colors, '#FFF', null, 10, 10, 0, WEAPONS_MAX_HEAT ); } p.update = function() { var heat = registry.levelShipWeapons[registry.levelShipWeapons.length-1].heat; this.value = heat; } p.layout = function(area) { this.width = area.width; this.height = area.height; } window.CooldownBar = CooldownBar; }()); // (function() { // "use strict"; // var CooldownBar = function() { // this.initialize(); // } // var p = CooldownBar.prototype = new createjs.Container(); // p.Container_initialize = p.initialize; // p.initialize = function() { // this.Container_initialize(); // this.colors = ['#FFF59A', // '#F7C41B', // '#EB9A03', // '#DD7C07', // '#A72E11']; // this.area = null; // this.barWidth = 0; // this.background = new createjs.Shape(); // this.addChild(this.background); // } // p.update = function() { // // console.log(registry.levelShipWeapons); // var heat = registry.levelShipWeapons[registry.levelShipWeapons-1]; // var x = 0; // for (var i=0; i<5; i++) { // var th = Math.pow(2, i); // if (heat >= th) { // this.background.graphics.beginFill(this.colors[i]); // } else { // this.background.graphics.beginFill('#f3f3f3'); // } // this.background.graphics.drawRect(x, 0, this.barWidth, this.area.height); // x += this.barWidth + 2 // } // } // p.layout = function(area) { // this.area = area; // this.barWidth = (area.width-8)/5; // this.background.graphics.clear(); // this.background.graphics.beginFill('#f3f3f3'); // var x = 0; // for (var i=0; i<5; i++) { // this.background.graphics.drawRect(x, 0, this.barWidth, area.height); // x += this.barWidth + 2 // } // } // window.CooldownBar = CooldownBar; // }());