Compare commits

...

2 Commits

Author SHA1 Message Date
YZ\249929363 6a07a4f30d Merge branch 'main' of https://git.sparkus.cn/yangzhao/cb 2025-07-07 18:04:04 +08:00
YZ\249929363 7e80de0bbc 更新 2025-07-07 18:03:55 +08:00
12 changed files with 224 additions and 12 deletions

View File

@ -6196,8 +6196,8 @@
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_left": -5.46229728115577e-14,
"_right": 5.46229728115577e-14,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,

View File

@ -499,6 +499,24 @@ export default class Block extends cc.Component {
this.node.off(cc.Node.EventType.TOUCH_MOVE);
this.node.off(cc.Node.EventType.TOUCH_CANCEL);
this.node.off(cc.Node.EventType.TOUCH_END);
if(diraction == 2 || diraction == 3){
// 获取当前节点的宽度和高度
const currentWidth = this.node.width;
const currentHeight = this.node.height;
// 假设将高度增加 50你可以根据需求修改这个值
const newHeight = currentHeight + 50;
// 设置新的节点尺寸
this.node.setContentSize(currentWidth, newHeight);
}
else if(diraction == 0 || diraction == 1){
// 获取当前节点的宽度和高度
const currentWidth = this.node.width;
const currentHeight = this.node.height;
// 假设将高度增加 50你可以根据需求修改这个值
const newWidth = currentWidth + 50;
// 设置新的节点尺寸
this.node.setContentSize(newWidth, currentHeight);
}
this.node.addComponent(cc.Mask);
let self = this;
let pos = this.node.getPosition();
@ -570,6 +588,8 @@ export default class Block extends cc.Component {
}
}
MapConroler._instance.judgeWin();
setTimeout(() => {
let tempColor = this.color;
setTimeout(() => {
@ -742,6 +762,7 @@ export default class Block extends cc.Component {
var self = this;
this.removeMapBlock();
MapConroler._instance.judgeWin();
setTimeout(() => {
let pos = this.node.getPosition();
if(self.type == BlockType.){

View File

@ -212,6 +212,7 @@ export default class GameManager extends cc.Component {
//@ts-ignore
if (typeof wx !== 'undefined' && wx !== null) {
MiniGameSdk.API.shushu_Init();
MiniGameSdk.API.yinli_Init();
Utils.getUserInfo((data)=>{
console.log("登陆成功",data);
});

View File

@ -217,6 +217,7 @@ export default class MapConroler extends cc.Component {
startUpdate() {
if (this.gameStart == false) {
this.gameStart = true;
this.count_Time = Date.now();
//发送数数事件——进入关卡
console.log("准备进入下一关,发送下一关进入");
if((cc.fx.GameConfig.GM_INFO.level + 1) == 1) {
@ -237,7 +238,6 @@ export default class MapConroler extends cc.Component {
this.timeNumber = cc.fx.GameConfig.LEVEL_INFO[0].time;
console.log("当前关卡时间", this.timeNumber);
this.count_Time = 0;
this.add_Time = 0;
NumberToImage.getTimeMargin(this.timeNumber, 50, "time_", this.timeLabel)
@ -1327,6 +1327,14 @@ export default class MapConroler extends cc.Component {
}
judgeWin(){
this.blockNum = this.blocks.length;
if((this.blockNum == 0 || this.blockNum == 1) &&!this.gameWin &&!this.gameOver){
this.stopTimeCutDown();
this.stopBoom();
}
}
//判断游戏成功下一关
nextLevel() {
this.pause = false;
@ -1342,7 +1350,8 @@ export default class MapConroler extends cc.Component {
// console.log("即将上报成功________________________:",this.add_Time);
// console.log("成功消除一个",this.add_Time);
cc.fx.GameTool.changeCoin(40);
let overTime = Date.now();
this.count_Time = overTime - this.count_Time;
cc.fx.GameTool.addLevel(this.count_Time, this.add_Time);
const winCOIN = cc.find("Canvas"); // 假设 Canvas 节点
if (winCOIN) {
@ -1530,6 +1539,8 @@ export default class MapConroler extends cc.Component {
this.node.parent.parent.getChildByName("Lose").getChildByName("Boom").active = false;
this.node.parent.parent.getChildByName("Lose").getChildByName("Lock").active = false;
this.node.parent.parent.getChildByName("Lose").getChildByName("Health").active = true;
let overTime = Date.now();
this.count_Time = overTime - this.count_Time;
let data = {
time: this.count_Time,
add_Time: this.add_Time,
@ -1666,7 +1677,6 @@ export default class MapConroler extends cc.Component {
}
else {
this.timeNumber -= 1;
this.count_Time += 1;
var timeTemp = cc.fx.GameTool.getTimeMargin(this.timeNumber);
NumberToImage.getTimeMargin(this.timeNumber, 50, "time_", this.timeLabel)
// this.timeLabel.string = timeTemp.toString();

View File

@ -195,7 +195,8 @@ export default class SceneManager extends cc.Component {
cc.fx.GameTool.setUserHealth(-1, (data) => {
})
if (MapConroler._instance.count_Time) {
let count_Time = MapConroler._instance.count_Time;
let overTime = Date.now();
let count_Time = overTime - MapConroler._instance.count_Time;
let add_Time = MapConroler._instance.add_Time;
let data = {
time: count_Time,

View File

@ -1103,6 +1103,7 @@ export namespace MiniGameSdk {
}
//#region 数数平台
/*
*
*/
@ -1116,14 +1117,16 @@ export namespace MiniGameSdk {
if (test == "正式版") {
appId = "87d18958cea145f29d3265470ecd3486";
}
const isProduction = test === '正式版'; // 假设使用 NODE_ENV 区分环境
var config = {
// appId: "73e1ec654f15b47a1a7354fbabec05ad", // 项目 APP ID
appId: appId,
serverUrl: "https://data.nika4fun.com/sync_data", // 上报地址
autoTrack: {
appShow: true, // 自动采集 ta_mg_show
appHide: true // 自动采集 ta_mg_hide
}
},
// 根据环境变量设置 debug 模式
debug: !isProduction
};
// 创建 TA 实例
API._ta = new ThinkingAnalyticsAPI(config);
@ -1200,6 +1203,18 @@ export namespace MiniGameSdk {
}
}
}
//#region 引力平台-
static yinli_Init(){
const config = {
accessToken: "aGws0nluotbm6Jjiv9WMuzOAbXLydxwe", // 项目通行证,在:网站后台-->设置-->应用列表中找到Access Token列 复制(首次使用可能需要先新增应用)
clientId: cc.fx.GameConfig.GM_INFO.openid, // 用户唯一标识如产品为小游戏则必须填用户openid注意不是小游戏的APPID
name: "ge", // 全局变量名称
debugMode: "debug", // 是否开启测试模式,开启测试模式后,可以在 网站后台--设置--元数据--事件流中查看实时数据上报结果。测试时使用上线之后一定要关掉改成none或者删除
};
const ge = new GravityAnalyticsAPI(config);
ge.setupAndStart();
}
}
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,10 @@
{
"ver": "1.1.0",
"uuid": "ff9bbc79-743c-47c9-8e26-683c1472454c",
"importer": "javascript",
"isPlugin": true,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}

View File

@ -55,12 +55,12 @@ export class GameConfig {
static PROP_INFO: ({ pos1: { x: number; y: number; z: number; }; pos2: { x: number; y: number; z: number; }; pos3: { x: number; y: number; z: number; }; pos4: { x: number; y: number; z: number; }; pos5: { x: number; y: number; z: number; }; pos6: { x: number; y: number; z: number; }; } | { pos1: { x: number; y: number; z: number; }; pos2: { x: number; y: number; z: number; }; pos3: { x: number; y: number; z: number; }; pos4: { x: number; y: number; z: number; }; pos5: { x: number; y: number; z: number; }; pos6?: undefined; })[];
static NEW_LEVEL: any;
static TA: any;
static GE: any;
static GM_INFO: {
// isEnd: false,
mean_Time: number; //平均放箭速度
hp: number; //体力值
review: number; //复活次数
//复活次数
currSeed: number; //用于随机数种子
openid: string; //微信用户唯一id
gameId: string; //游戏ID
@ -81,16 +81,18 @@ export class GameConfig {
first: boolean; //是否首次进入游戏
score: number; //总得分
scale: number; //玩家总计成功点火数
iosOutTradeNo: number; //每次上一把最小步数
iosOutTradeNo: number; //ios订单号
min_Time: number; //体力恢复的剩余时间
freezeAmount: number; //冻结道具次数
hammerAmount: number; //锤子道具次数
magicAmount: number; //魔法棒道具次数
musicOpen: boolean; //音乐
effectOpen: boolean; //音效
vibrateOpen: boolean;
vibrateOpen: boolean; //震动
coinnum: number; //每局的金币数
paid_user: boolean;
};
//游戏内信息
static get Instance()
@ -221,6 +223,7 @@ export class GameConfig {
effectOpen: true, //音效
vibrateOpen: true, //震动
coinnum: 0, //每局的金币数
paid_user: false, //是否是付费用户
};
// this.setCode(this.getKey("scode"));
// this.GM_INFO.level = 0;

144
assets/libs/GravityAnalyticsSDK.d.ts vendored Normal file
View File

@ -0,0 +1,144 @@
declare class GravityAnalyticsAPI {
constructor(config: any);
setupAndStart(options?: { clientId?: string; openId?: string }): void;
track(eventName: string): void;
preInit(): void;
track(eventName: string, properties: any): void;
track(eventName: string, properties: any, time: any): void;
track(eventName: string, properties: any, time: any, onComplete: any): void;
track(taEvent: any): void;
timeEvent(eventName: string): void;
login(accoundId: string): void;
logout(): void;
setSuperProperties(properties: any): void;
unsetSuperProperty(properties: any): void;
clearSuperProperties(): void;
getSuperProperties(): any;
getSendProperties(): any;
registerEvent(): void;
loginEvent(): void;
logoutEvent(): void;
payEvent(
pay_amount: number,
pay_type: string,
order_id: string,
pay_reason: string,
pay_method: string
): void;
payEventToTencent(pay_amount: number): void;
tryPayEventDryRun(pay_amount: number): void;
tryTutorialFinishEventDryRun(): void;
tryRegisterEventDryRun(): void;
tryCreateRoleEventDryRun(role_name: string): void;
adShowEvent(ad_type: string, ad_unit_id: string, otherProperties: any): void;
bindTAThirdPlatform(taAccountId: string, taDistinctId: string): void;
initialize(data: any): any;
initializeWithHistoryUserInfo(
data: any,
history_info: {
company: string;
create_time: number;
}
): any;
userSet(properties: any): void;
userSetOnce(properties: any): void;
userAppend(properties: any): void;
userUniqAppend(properties: any): void;
userAdd(properties: any): void;
userUnset(property: string): void;
userDel(): void;
authorizeOpenID(distinctId: string): void;
identify(distinctId: string): void;
initInstance(name: string): GravityAnalyticsAPI;
initInstance(name: string, config: any): GravityAnalyticsAPI;
lightInstance(name: string): any;
setDynamicSuperProperties(properties: any): void;
getDeviceId(callback?: any): string;
getDistinctId(callback?: any): string;
getAccountId(callback?: any): string;
getPresetProperties(callback?: any): any;
getWechatOpenId(
code: string
): Promise<{ session_key: string; openid: string; unionid: string }>;
sendDryRunResult(
traceId: string,
action: string
): Promise<{
extra: {
error: string;
};
code: number;
msg: string;
}>;
onPayEvent(
pay_amount: number,
pay_type: string,
order_id: string,
pay_reason: string,
pay_method: string
): void;
onRegisterEvent(): void;
onCreateRoleEvent(role_name: string): void;
onCreateRoleEventWithParams(role_name: string, params: any): void;
onTutorialFinishEvent(): void;
onTutorialFinishEventWithParams(params: any): void;
onViewMallContentEvent(): void;
onViewMallContentEventWithParams(params: any): void;
onViewActivityContentEvent(): void;
onViewActivityContentEventWithParams(params: any): void;
onAddToWishListEvent(wishType: string): void;
onAddToWishListEventWithParams(wishType: string, params: any): void;
onShareEvent(shareType: "APP_MESSAGE" | "TIME_LINE"): void;
onShareEventWithParams(
shareType: "APP_MESSAGE" | "TIME_LINE",
params: any
): void;
onUpdateLevelEvent(userLevel: number, userPower: number): void;
onUpdateLevelEventWithParams(
userLevel: number,
userPower: number,
params: any
): void;
getKuaishouOpenId(
code: string
): Promise<{ session_key: string; openid: string; unionid: string }>;
getDouyinOpenId(
code: string
): Promise<{ session_key: string; openid: string; unionid: string }>;
getBilibiliOpenId(
code: string
): Promise<{ session_key: string; openid: string; unionid: string }>;
/**
* /
* @param {bool} enabled YES NO
* @deprecated This method is deprecated, use setTrackStatus() instand.
*/
enableTracking(enabled: boolean): void;
/**
*
* @deprecated This method is deprecated, use setTrackStatus() instand.
*/
optOutTracking(): void;
/**
* user_del
* @deprecated This method is deprecated, use setTrackStatus() instand.
*/
optOutTrackingAndDeleteUser(): void;
/**
*
* @deprecated This method is deprecated, use setTrackStatus() instand.
*/
optInTracking(): void;
/**
*
* PAUSE
* STOP
* SAVE_ONLY (Native原生可支持JS暂不支持此状态 NORMAL)
* NORMAL
* @param {string} status
*/
setTrackStatus(status: string): void;
}

View File

@ -0,0 +1,6 @@
{
"ver": "2.0.2",
"uuid": "3133d8a4-37df-4a5f-8b47-9cc1a74bd339",
"importer": "text",
"subMetas": {}
}

View File

@ -1,5 +1,5 @@
{
"last-module-event-record-time": 1751270952307,
"last-module-event-record-time": 1751876016726,
"group-list": [
"default",
"Map"