1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- import CountDownSchedule from "./CountDownSchedule";
- export class Global {
-
- //是否开发环境
- public static IsDevelop = false;
- //事件类型
- public static EventType_AddScore = "AddScore";
- public static EventType_MinusScore = "MinusScore";
- public static EventType_ShowTips = "ShowTips";
- public static EventType_GameOver = "GameOver";
- //音效
- public static Audio_Bg = "/audio/bg"
- public static Audio_Success="/audio/success"
- public static Audio_GameFail="/audio/gameFail"
- public static Audio_TimeOutFail="/audio/timeOutFail"
-
- //游戏
- public static StartLv = 1;
- public static MaxLv = 5;
- public static GameSetTime = 60;
- public static DifficultyRate=1; //游戏难度系数
- //全局定时器
- public static cdSchedule: CountDownSchedule = new CountDownSchedule();
- /**
- * 获取xxx-xxx之间的随机数
- * @param min 最小数
- * @param max 最大数
- * @returns 随机数字
- */
- public static getRandom(min, max): number {
- return Math.floor(Math.random() * (max - min + 1)) + min;
- }
- /**
- * 获取两个数字之差
- * @param num1
- * @param num2
- * @returns
- */
- public static getDifference(num1, num2): number {
- return Math.abs(num1 - num2);
- }
- }
|