CosntValue.ts 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import { Vec3 } from "cc";
  2. export class CosntValue {
  3. public static EventType_ShowStartGameBg = "ShowStartGameBg";
  4. public static EventType_RefreshScore = "RefreshScore";
  5. public static EventType_RefreshLevel = "RefreshLevel";
  6. public static EventType_TimerChange = "TimerChange";
  7. public static EventType_NextLv = "NextLv";
  8. public static EventType_GameOver = "GameOver";
  9. public static EventType_GameAllOver = "GameAllOver";
  10. public static EventType_ShowTips = "ShowTips";
  11. public static Audio_Mm_Cg = "/MemoryMaster/Mm_Cg"
  12. public static Audio_Mm_Sb = "/MemoryMaster/Mm_Sb"
  13. public static Audio_Mm_Xz = "/MemoryMaster/Mm_Xz"
  14. public static Prefab_Mm_Game = "/MemoryMaster/Game"
  15. public static Audio_Hs_Cg = "/HappyShopping/Hs_Cg"
  16. public static Audio_Hs_Sb = "/HappyShopping/Hs_Sb"
  17. public static Audio_Hs_Win = "/HappyShopping/Hs_Win"
  18. public static Prefab_Hs_Game = "/HappyShopping/Game"
  19. public static Audio_Sc_Start = "/SkiingChampion/Sc_Start"
  20. public static Audio_Sc_Win = "/SkiingChampion/Sc_Win"
  21. public static Audio_Sc_Sb = "/SkiingChampion/Sc_Sb"
  22. public static Prefab_Sc_Game = "/SkiingChampion/Game"
  23. public static Audio_Kj_Sb = "/KangarooJump/Kj_Sb"
  24. public static Audio_Kj_Over = "/KangarooJump/Kj_Over"
  25. public static Audio_Kj_Jump = "/KangarooJump/Kj_Jump"
  26. public static Prefab_Kj_Game = "/KangarooJump/Game"
  27. public static StartLv = 5;
  28. public static MaxLv = 10;
  29. public static currGame: Game_type = null;
  30. public static randomInt(min, max) {
  31. return Math.floor(Math.random() * (max - min + 1)) + min;
  32. }
  33. public static randomSort(a) {
  34. return a.sort(() => Math.random() - 0.5);
  35. }
  36. //计算贝塞尔曲线坐标函数
  37. public static twoBezier(t: number, p1: Vec3, cp: Vec3, p2: Vec3) {
  38. let x = (1 - t) * (1 - t) * p1.x + 2 * t * (1 - t) * cp.x + t * t * p2.x;
  39. let y = (1 - t) * (1 - t) * p1.y + 2 * t * (1 - t) * cp.y + t * t * p2.y;
  40. return new Vec3(x, y, 0);
  41. }
  42. }
  43. export enum Hs_ColliderType {
  44. Player = 1,
  45. Goods = 2,
  46. OtherMan = 3,
  47. }
  48. export enum Sc_ColliderType {
  49. Player = 1,
  50. Obs = 2,
  51. }
  52. export enum Game_type {
  53. None = 0, // 无
  54. MemoryMaster = 1, // 记忆大师
  55. HappyShopping = 2, // 快乐大购物
  56. SkiingChampion = 3, // 滑雪冠军
  57. KangarooJump = 4, // 袋鼠跳一跳
  58. }