feat: group 1.0.0

This commit is contained in:
zzc
2026-05-12 06:46:31 +08:00
parent 493b4709bc
commit 2fc90c1219
55 changed files with 23561 additions and 1767 deletions

View File

@@ -18,6 +18,24 @@ export class GlobalData {
public static speedRate: number = 1;
// 每次闯关增加的速率
public static speedRateAdd: number = 0.2;
//获取当前选择的音乐的信息
public static get currentMusicInfo(): any {
//从本地缓存中获取(默认)
return (
Utils.getCache(GameStorageKeyConfig.CurrentMusicInfo) || {
id: 1,
title: "Like A Dino!",
bestScore: 0,
isLocked: 0,
unlockGold: 0,
}
);
}
//设置当前选择的音乐的信息
public static set currentMusicInfo(value) {
//存储到本地缓存中
Utils.setCache(GameStorageKeyConfig.CurrentMusicInfo, value);
}
// 获取当前选择的音乐 id
public static get selectedMusicID(): number {
return Utils.getCache(GameStorageKeyConfig.SelectedMusicID) || 1;
@@ -27,6 +45,55 @@ export class GlobalData {
//存储到本地缓存中
Utils.setCache(GameStorageKeyConfig.SelectedMusicID, value);
}
//获取当前选择的小恐龙ID(默认是1)
public static get selectedDinoID() {
return parseInt(Utils.getCache(GameStorageKeyConfig.SelectedDinoID)) || 1;
}
//设置当前选择的小恐龙ID
public static set selectedDinoID(value) {
//存储到本地缓存中
Utils.setCache(GameStorageKeyConfig.SelectedDinoID, value);
}
//获取解锁了哪些音乐的ID列表
public static get unlockMusicIDList() {
//从本地缓存中获取(默认)
return Utils.getCache(GameStorageKeyConfig.UnlockMusicIDList) || [];
}
//存储解锁了哪些音乐的ID列表
public static set unlockMusicIDList(value) {
//存储到本地缓存中
Utils.setCache(GameStorageKeyConfig.UnlockMusicIDList, value);
}
//获取当前选择的小恐龙的信息
public static get currentDinoInfo(): any {
//从本地缓存中获取(默认)
return (
Utils.getCache(GameStorageKeyConfig.CurrentDinoInfo) || {
id: 1,
name: "小恐龙1",
desc: "Dino:Will you marry me?",
isLocked: 0,
unlockGold: 0,
dinoColor: "#ffffff",
bgColor: "#cce5cd",
}
);
}
//设置当前选择的小恐龙的信息
public static set currentDinoInfo(value) {
//存储到本地缓存中
Utils.setCache(GameStorageKeyConfig.CurrentDinoInfo, value);
}
//获取解锁了哪些小恐龙的ID列表
public static get unlockDinoIDList() {
//从本地缓存中获取(默认)
return Utils.getCache(GameStorageKeyConfig.UnlockDinoIDList) || [];
}
//存储解锁了哪些小恐龙的ID列表
public static set unlockDinoIDList(value) {
//存储到本地缓存中
Utils.setCache(GameStorageKeyConfig.UnlockDinoIDList, value);
}
//获取玩家累计的总得分(总的金币数)
public static get totalScore() {
//从本地缓存中获取