(function(){var t,e,i,s={}.hasOwnProperty,n=function(t,e){function i(){this.constructor=t}for(var n in e)s.call(e,n)&&(t[n]=e[n]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},h=function(t,e){return function(){return t.apply(e,arguments)}};i=function(t){function e(t){this.canvas=t,e.__super__.constructor.call(this),this.dx=[0,0],this.graphics.beginFill("#01EFFF").drawRect(0,0,60,10),this.border=this.canvas.width-60}return n(e,t),e.prototype.init=function(){return this.x=this.border/2,this.y=this.canvas.height-10},e.prototype.tick=function(){return this.x+=this.dx[0]+this.dx[1],this.x<0&&(this.x=0),this.x>this.border?this.x=this.border:void 0},e.prototype.setLeft=function(t){return this.dx[0]=t},e.prototype.setRight=function(t){return this.dx[1]=t},e}(createjs.Shape),t=function(t){function e(t){this.canvas=t,e.__super__.constructor.call(this),this.graphics.beginFill("#6b0000").drawCircle(0,0,5),this.maxwidth=this.canvas.width,this.maxheight=this.canvas.height-10,this.ddx=[0,0]}return n(e,t),e.prototype.init=function(){return this.x=this.maxwidth/2,this.y=this.maxheight-5},e.prototype.tick=function(){return this.x+=this.ddx[0]+this.ddx[1]},e.prototype.setLeft=function(t){return this.ddx[0]=t},e.prototype.setRight=function(t){return this.ddx[1]=t},e}(createjs.Shape),e=function(){function e(e){this.handleKeyUp=h(this.handleKeyUp,this),this.handleKeyDown=h(this.handleKeyDown,this),this.canvas=document.getElementById(e),this.canvas.width=this.canvas.parentNode.offsetWidth-10,this.plate=new i(this.canvas),this.ball=new t(this.canvas),document.onkeydown=this.handleKeyDown,document.onkeyup=this.handleKeyUp}var s,n;return s=37,n=39,e.prototype.init=function(){return this.plate.init(),this.ball.init(),this.stage=new createjs.Stage(this.canvas),this.stage.addChild(this.plate),this.stage.addChild(this.ball),createjs.Ticker.useRAF=!0,createjs.Ticker.setFPS(60),createjs.Ticker.addListener(this)},e.prototype.reset=function(){return this.stage.removeAllChildren(),createjs.Ticker.removeAllListeners(),this.stage.update()},e.prototype.tick=function(){return this.plate.tick(),this.ball.tick(),this.stage.update()},e.prototype.handleKeyDown=function(t){switch(t||(t=window.event),t.keyCode){case s:return this.plate.setLeft(-1),this.ball.setLeft(-1);case n:return this.plate.setRight(1),this.ball.setRight(1)}},e.prototype.handleKeyUp=function(t){switch(t||(t=window.event),t.keyCode){case s:return this.plate.setLeft(0),this.ball.setLeft(0);case n:return this.plate.setRight(0),this.ball.setRight(0)}},e}(),window.easeljs2_2=new e("easeljs2_2")}).call(this);