!function(){function e(e){QyLayer.call(this,qyengine.addToObj({sticky:!0},e));this.varLabels={};current_game.drawScore&&this.drawVariable("score","score:"+current_game.score,0,0);current_game.drawLives&&this.drawVariable("lives","lives:"+current_game.lives,200,0);current_game.drawHealth&&this.drawVariable("health","health:"+current_game.health,400,0)}inherits(e,QyLayer);window.QyStickyLayer=e;e.prototype.drawVariable=function(e,i,t,r,a,n){var s=this.varLabels[e];if(!s){s=qyengine.makeLabel();this.varLabels[e]=s;this.appendChild(s)}var l=getStyleFromFont(a);l.wordWrap=!1;s.setStyle(l);s.setSize({width:200,height:100});n&&n.size&&s.setSize(n.size);s.setText(i);null!=t&&s.setPosition(t,r);return this};e.prototype.updateHealthImage=function(e,i,t,r){if(this.healthSprite){var a;if(null==e||null==i){a=this.healthSprite.getPosition();null==e&&(e=a.x);null==i&&(i=a.y)}if(t||r){a||(a=this.healthSprite.getPosition());t&&(e+=a.x);r&&(i+=a.y)}this.healthSprite.setPosition(e,i);var n=Math.max(Math.min(current_game.health,1),0),s=this.healthSprite.constructor.defaultOpt.size;this.healthSprite.setSize(s.width*n,s.height*n)}};e.prototype.drawLifeImage=function(e,i,t,r,a,n){if(!this.lifeImgContainer){this.lifeImgContainer=new PIXI.DisplayObjectContainer;this.appendChild(this.lifeImgContainer)}n||(n=this.lifeImgContainer.spacer||0);this.lifeImgContainer.spacer=n;if(t){t.classId&&(t=t.classId);if(this.lifeImgContainer.spriteName!=t){this.lifeImgContainer.children.length&&this.lifeImgContainer.removeChildren();this.lifeImgContainer.spriteName=t}}else{if(!this.lifeImgContainer.spriteName)return;t=this.lifeImgContainer.spriteName}var s;if(null==e||null==i){s=this.lifeImgContainer.getPosition();null==e&&(e=s.x);null==i&&(i=s.y)}if(r||a){s||(s=this.lifeImgContainer.getPosition());r&&(e+=s.x);a&&(i+=s.y)}this.lifeImgContainer.setPosition(e,i);var l=this.lifeImgContainer.children_||this.lifeImgContainer.children,h=l.length,o=current_game.lives;o>=0||(o=0);if(h>o)for(var g=h-1;g>=o;g--)this.lifeImgContainer.removeChildAt(g);else if(o>h){var f=qyengine.guardType(t);if(f)for(g=0;o-h>g;g++){var m=new f;m.setPosition((g+h)*(n+m.width),0);this.lifeImgContainer.appendChild(m)}}}}();