TrucoSoundFun.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. cc.Class({
  2. extends: cc.Component,
  3. properties: {
  4. },
  5. statics: {
  6. EFFECT_NUM: 3,
  7. AN_GANG_NUM_W: 2,
  8. RAW_KIND: "",
  9. GAME_BACKGRUAND: "bgm",//背景音乐
  10. WARNING: "alarm",//显示牌动画声音
  11. EX_BUTTON: "open",//
  12. EX_COUNTDOWN: "time",//倒计时声音
  13. GAME_START: "start_game",
  14. GAME_WIN: "win",
  15. GAME_LOSE: "lose",
  16. DIAN_PAO: "dianpao",
  17. SHUFFLE: "washcard1",
  18. SENDCARD: "washcard2",
  19. MOVECARD: "movecard",
  20. CARD: "card",
  21. OUTKING: "outking",
  22. WINKING: "kingwin",
  23. ADDBET: "addbet",
  24. THROW_COIN: "bet",
  25. PICK_COIN: "coin",
  26. TRUCO_TY: "tytruco",
  27. TRUCO_FQ: "fqtruco",
  28. LG_PATH_SC: "",
  29. LG_FLAG_SC: "local/",
  30. LG_FLAG_PT: "putong/",
  31. bgmAudioID:-1,
  32. setPuTong(puTong) {
  33. },
  34. playBackMusic(kName) {
  35. var path = this.LG_PATH_SC + kName;
  36. if (cc.vv && cc.vv.audioMgr) {
  37. this.bgmAudioID = cc.vv.audioMgr.playBGM(path);
  38. }
  39. },
  40. stopBackMusic() {
  41. if (cc.vv && cc.vv.audioMgr) {
  42. cc.vv.audioMgr.stopBackMusic();
  43. }
  44. },
  45. playEffect(kName, preload) {
  46. var path = this.LG_PATH_SC + kName;
  47. if (cc.vv && cc.vv.audioMgr) {
  48. var audioID = cc.vv.audioMgr.playSFX(path);
  49. }
  50. },
  51. playEffectDefineString(kName, preload) {
  52. if (cc.vv && cc.vv.audioMgr) {
  53. var audioID = cc.vv.audioMgr.playSFX(kName);
  54. }
  55. },
  56. playCardTypeByGender(iGender, cardpoint) {
  57. var path = "";
  58. if (iGender > 0) {
  59. path = "man/" + "cow_" + cardpoint ;
  60. }else{
  61. path = "woman/" + "cow_" + cardpoint ;
  62. }
  63. return this.playEffect(path, false);
  64. },
  65. playTypeByGender(iGender, type) {
  66. var path = "";
  67. if (iGender > 0) {
  68. path = "man/" + "type_" + type ;
  69. }else{
  70. path = "woman/" + "type_" + type ;
  71. }
  72. return this.playEffect(path, false);
  73. },
  74. playEffectByGender(iGender, kName) {
  75. var path = "";
  76. if (iGender > 0) {
  77. path = "man/" + kName ;
  78. }else{
  79. path = "woman/" + kName ;
  80. }
  81. return this.playEffect(path, false);
  82. },
  83. playEffectEX(kName) {
  84. var path = this.LG_PATH_SC + "effect/" + kName;
  85. if (cc.vv && cc.vv.audioMgr) {
  86. var audioID = cc.vv.audioMgr.playSFX(path);
  87. }
  88. },
  89. getDefineSound(iGender, kStr) {
  90. var value = "fix_msg_" + kStr;
  91. var path = this.LG_PATH_SC;
  92. if (iGender > 0) {
  93. path += "talk/man/" + value + this.RAW_KIND;
  94. }else{
  95. path += "talk/woman/" + value + this.RAW_KIND;
  96. }
  97. return path;
  98. },
  99. },
  100. // LIFE-CYCLE CALLBACKS:
  101. // onLoad () {},
  102. start () {
  103. },
  104. // update (dt) {},
  105. });