GameOverPage.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. GameOverPage:{
  5. default: null,
  6. type: cc.Node
  7. },
  8. ChooseDimensionPage: {
  9. default: null,
  10. type: cc.Node
  11. },
  12. GameResult:{
  13. default: null,
  14. type: cc.Node
  15. },
  16. },
  17. start () {
  18. },
  19. ReplayBtnOnClick(){
  20. this.ChooseDimensionPage.active = true;
  21. this.GameOverPage.active = false;
  22. },
  23. SetGameResut(TimingNum,TimingText){
  24. var TimeTitle = '';
  25. if(TimingNum<=5){
  26. TimeTitle='记忆大师'
  27. }else if(TimingNum>=6&&TimingNum<=12){
  28. TimeTitle='技高一等'
  29. }else if(TimingNum>=13&&TimingNum<=20){
  30. TimeTitle='机智过人'
  31. }else if(TimingNum>=21&&TimingNum<=30){
  32. TimeTitle='过目不忘'
  33. }else if(TimingNum>30){
  34. TimeTitle='技不如人'
  35. }
  36. var ResultText = TimingText+'挑战成功\n' +
  37. '获得【'+TimeTitle+'】称号';
  38. this.GameResult.getChildByName('ResultText').getComponent(cc.Label).string = ResultText;
  39. }
  40. });