(function() { "use strict"; var Planet = function(scene, radius, resources) { this.scene = scene; this.radius = radius; this.resources = resources; this.circumference = radius*Math.PI*2; this.background = new createjs.Container(); this.foreground = new createjs.Container(); this._redraw(); } var p = Planet.prototype p._redraw = function() { this.background.removeAllChildren(); this.foreground.removeAllChildren(); var factor = this.radius*.9; var ifactor = (this.radius-factor)/2; var ix = Math.random()*ifactor*2 - ifactor; var iy = Math.random()*ifactor*2 - ifactor; var atmosphere = parseInt(this.radius*1.25); var shape = new createjs.Shape(); shape.graphics // outer // .f('#644733') .bf(game.load.get('img_ground2'), 'repeat') .dc(0, 0, this.radius*1.03) // inner // .f('#8D7260') .bf(game.load.get('img_ground1'), 'repeat') .dc(ix, iy, factor) this.foreground.addChild(shape); shape = new createjs.Shape(); shape.graphics .rf(["#81CED4", "rgba(0, 0, 0, 0.0)"], [0, 1], 0, 0, this.radius*.5, 0, 0, atmosphere) .dc(0, 0, atmosphere); this.background.addChild(shape); } window.Planet = Planet; })();