CNextLevel.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. function CNextLevel(){
  2. var _oMsgText;
  3. var _oMatchTextScore;
  4. var _oMsgTimeScore;
  5. var _oMsgTotalScore;
  6. var _oMsgLevelScore;
  7. var _oContinueButton;
  8. var _oGroup;
  9. this._init = function(){
  10. _oGroup = new createjs.Container();
  11. _oGroup.alpha = 0;
  12. _oGroup.visible = false;
  13. s_oStage.addChild(_oGroup);
  14. var oBg = createBitmap(s_oSpriteLibrary.getSprite("msg_box"));
  15. _oGroup.addChild(oBg);
  16. _oMsgText = new CTLText(_oGroup,
  17. CANVAS_WIDTH/2-300, (CANVAS_HEIGHT/2) - 150, 600, 48,
  18. 48, "center", "#fff", FONT_GAME, 1,
  19. 0, 0,
  20. TEXT_LEVELCOMPLETED,
  21. true, true, false,
  22. false );
  23. _oMsgText.setShadow("#000000", 3, 3, 2);
  24. _oMatchTextScore = new CTLText(_oGroup,
  25. CANVAS_WIDTH/2-300, (CANVAS_HEIGHT/2) - 70, 600, 30,
  26. 30, "center", "Pink", FONT_GAME, 1,
  27. 0, 0,
  28. TEXT_MATCH_SCORE,
  29. true, true, false,
  30. false );
  31. _oMatchTextScore.setShadow("#000000", 2, 2, 2);
  32. _oMsgTimeScore = new CTLText(_oGroup,
  33. CANVAS_WIDTH/2-300, (CANVAS_HEIGHT/2) - 34, 600, 30,
  34. 30, "center", "Pink", FONT_GAME, 1,
  35. 0, 0,
  36. TEXT_TIMEBONUS,
  37. true, true, false,
  38. false );
  39. _oMsgTimeScore.setShadow("#000000", 2, 2, 2);
  40. _oMsgLevelScore = new CTLText(_oGroup,
  41. CANVAS_WIDTH/2-300, (CANVAS_HEIGHT/2), 600, 34,
  42. 34, "center", "Pink", FONT_GAME, 1,
  43. 0, 0,
  44. TEXT_LEVEL_SCORE,
  45. true, true, false,
  46. false );
  47. _oMsgLevelScore.setShadow("#000000", 2, 2, 2);
  48. _oMsgTotalScore = new CTLText(_oGroup,
  49. CANVAS_WIDTH/2-300, (CANVAS_HEIGHT/2) + 70, 600, 48,
  50. 48, "center", "Pink", FONT_GAME, 1,
  51. 0, 0,
  52. TEXT_TOTALSCORE,
  53. true, true, false,
  54. false );
  55. _oMsgTotalScore.setShadow("#000000", 2, 2, 2);
  56. _oContinueButton = new CTextButton(CANVAS_WIDTH/2,700,
  57. s_oSpriteLibrary.getSprite('but_menu_bg'),
  58. TEXT_CONTINUE,
  59. FONT_GAME,
  60. "White",
  61. "24",
  62. _oGroup);
  63. _oContinueButton.addEventListener(ON_MOUSE_UP, this.hide, this);
  64. };
  65. this.display = function(iMatchScore,iTimeBonus,iLevelScore,iTotalScore,iLevel){
  66. _oMatchTextScore.refreshText(TEXT_MATCH_SCORE+ " = " + iMatchScore);
  67. _oMsgTimeScore.refreshText(TEXT_TIMEBONUS + " = "+iTimeBonus);
  68. _oMsgLevelScore.refreshText(TEXT_LEVEL_SCORE + " = "+iLevelScore);
  69. _oMsgTotalScore.refreshText(TEXT_TOTALSCORE + " " + iTotalScore);
  70. _oGroup.visible = true;
  71. createjs.Tween.get(_oGroup).to({alpha:1},250);
  72. //$(s_oMain).trigger("save_score",iTotalScore);
  73. };
  74. this.hide = function(){
  75. _oGroup.alpha = 0;
  76. _oGroup.visible = false;
  77. s_oGame.nextLevel();
  78. };
  79. this.unload = function(){
  80. _oContinueButton.unload();
  81. s_oStage.removeChild(_oGroup);
  82. };
  83. this._init();
  84. }