CVictory.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. function CVictory(){
  2. var _oContinueButton;
  3. var _oMsgText;
  4. var _oMsgTotalScore;
  5. var _oGroup;
  6. this._init = function(){
  7. _oGroup = new createjs.Container();
  8. _oGroup.alpha = 0;
  9. _oGroup.visible = false;
  10. s_oStage.addChild(_oGroup);
  11. var oBg = createBitmap(s_oSpriteLibrary.getSprite("msg_box"));
  12. _oGroup.addChild(oBg);
  13. _oMsgText = new CTLText(_oGroup,
  14. CANVAS_WIDTH/2-300, (CANVAS_HEIGHT/2) -120, 600, 58,
  15. 58, "center", "#fff", FONT_GAME, 1,
  16. 0, 0,
  17. TEXT_VICTORY,
  18. true, true, false,
  19. false );
  20. _oMsgText.setShadow("#000000", 3, 3, 2);
  21. _oMsgTotalScore = new CTLText(_oGroup,
  22. CANVAS_WIDTH/2-300, (CANVAS_HEIGHT/2), 600, 80,
  23. 38, "center", "Pink", FONT_GAME, 1,
  24. 0, 0,
  25. TEXT_TOTALSCORE,
  26. true, true, false,
  27. false );
  28. _oMsgTotalScore.setShadow("#000000", 2, 2, 2);
  29. _oContinueButton = new CTextButton(CANVAS_WIDTH/2,700,
  30. s_oSpriteLibrary.getSprite('but_menu_bg'),
  31. TEXT_PLAY_AGAIN,
  32. FONT_GAME,
  33. "White",
  34. "24",
  35. _oGroup);
  36. _oContinueButton.addEventListener(ON_MOUSE_DOWN, this.unload, this);
  37. };
  38. this.display = function(iTotalScore){
  39. _oMsgTotalScore.refreshText(TEXT_TOTALSCORE + "\n" + iTotalScore);
  40. _oGroup.visible = true;
  41. createjs.Tween.get(_oGroup).to({alpha:1},250).call(function(){$(s_oMain).trigger("show_interlevel_ad");});;
  42. $(s_oMain).trigger("save_score",iTotalScore);
  43. };
  44. this.unload = function(){
  45. _oContinueButton.unload();
  46. s_oStage.removeChild(_oGroup);
  47. s_oGame.unload(false);
  48. };
  49. this._init();
  50. }