GameOver.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. function GameOver(){
  2. base(this,LSprite,[]);
  3. this.init();
  4. }
  5. GameOver.prototype.init = function(){
  6. var self = this;
  7. // var backgroundBitmapData = new LBitmapData(dataList["background"],0,0,640,960);
  8. // var backgroundBitmap = new LBitmap(backgroundBitmapData);
  9. // self.addChild(backgroundBitmap);
  10. // p
  11. var background = new Background();
  12. background.name = "background";
  13. self.addChild(background);
  14. var shareBitmapData = new LBitmapData(dataList["share"]);
  15. var shareBitmap = new LBitmap(shareBitmapData);
  16. shareBitmap.x = LGlobal.width-shareBitmap.width;
  17. shareBitmap.y = 0;
  18. shareBitmap.alpha = 0;
  19. Util.fadeIn(shareBitmap, 1);
  20. self.addChild(shareBitmap);
  21. var hook = new LSprite();
  22. var hookBitmapData = new LBitmapData(dataList["hook"],0,0,57,1100);
  23. var hookBitmap = new LBitmap(hookBitmapData);
  24. hookBitmap.x = -27.5;
  25. hookBitmap.y = -822;
  26. hook.x = LGlobal.width/2;
  27. hook.y = 0;
  28. hook.addChild(hookBitmap);
  29. self.addChild(hook);
  30. var logoBitmapData = new LBitmapData(dataList["logo"],0,0,640,960);
  31. var logoBitmap = new LBitmap(logoBitmapData);
  32. logoBitmap.x = LGlobal.width/2-logoBitmap.width/2;
  33. logoBitmap.y = LGlobal.height*0.87;
  34. logoBitmap.alpha = 0;
  35. Util.fadeIn(logoBitmap, 1);
  36. self.addChild(logoBitmap);
  37. // Util.sFloat(logoBitmap, 0.7);
  38. self.continueBtn = new LSprite();
  39. var continueBtnBitmapData = new LBitmapData(dataList["continue_btn"]);
  40. var continueBtnBitmap = new LBitmap(continueBtnBitmapData);
  41. self.continueBtn.addChild(continueBtnBitmap);
  42. self.continueBtn.x = LGlobal.width/2+continueBtnBitmap.width*0.1;
  43. self.continueBtn.y = LGlobal.height*0.55;
  44. self.continueBtn.alpha = 0;
  45. Util.fadeIn(self.continueBtn, 1);
  46. self.addChild(self.continueBtn);
  47. Util.sFloat(self.continueBtn, 0.7);
  48. self.moreBtn = new LSprite();
  49. var moreBtnBitmapData = new LBitmapData(dataList["more_btn"]);
  50. var moreBtnBitmap = new LBitmap(moreBtnBitmapData);
  51. self.moreBtn.addChild(moreBtnBitmap);
  52. self.moreBtn.x = LGlobal.width/2-moreBtnBitmap.width*1.1;
  53. self.moreBtn.y = LGlobal.height*0.55;
  54. self.moreBtn.alpha = 0;
  55. Util.fadeIn(self.moreBtn, 1);
  56. self.addChild(self.moreBtn);
  57. Util.sFloat(self.moreBtn, 0.7);
  58. var scoreTextField = new LTextField();
  59. scoreTextField.color = "#fffd71";
  60. scoreTextField.size = 48;
  61. scoreTextField.x = LGlobal.width/2;
  62. scoreTextField.y = LGlobal.height*0.3;
  63. scoreTextField.textAlign = "center";
  64. scoreTextField.weight = "bolder";
  65. scoreTextField.text = "得分:" + gScore.toString();
  66. scoreTextField.font = "黑体";
  67. self.scoreTextField = scoreTextField;
  68. self.scoreTextField.alpha = 0;
  69. Util.fadeIn(self.scoreTextField, 1);
  70. self.addChild(scoreTextField);
  71. var highScoreFlag = false;
  72. try {
  73. if(gScore > gHighScore) {
  74. gHighScore = localStorage["fishinglegendHighScore"] = gScore;
  75. highScoreFlag = true;
  76. }
  77. } catch(e) {}
  78. var highScoreTextField = new LTextField();
  79. highScoreTextField.color = "#fffd71";
  80. highScoreTextField.size = 36;
  81. highScoreTextField.x = LGlobal.width/2;
  82. highScoreTextField.y = LGlobal.height*0.4;
  83. highScoreTextField.textAlign = "center";
  84. highScoreTextField.weight = "bolder";
  85. highScoreTextField.text = "最高:" + gHighScore.toString();
  86. highScoreTextField.font = "黑体";
  87. self.highScoreTextField = highScoreTextField;
  88. self.highScoreTextField.alpha = 0;
  89. Util.fadeIn(self.highScoreTextField, 1);
  90. self.addChild(highScoreTextField);
  91. self.continueBtn.addEventListener(LMouseEvent.MOUSE_DOWN, self.onContinueBtnDown);
  92. self.moreBtn.addEventListener(LMouseEvent.MOUSE_DOWN, self.onMoreBtnDown);
  93. // updateShare(gScore);Play68.setRankingScoreDesc(gScore);
  94. //dp_submitScore(gScore);
  95. };
  96. GameOver.prototype.onContinueBtnDown = function(event) {
  97. gameStart();
  98. }
  99. GameOver.prototype.onMoreBtnDown = function(event) {
  100. //clickMore();
  101. Play68.goHome();
  102. }