Update Game Memory Shuffle: Hardcode level calculation and fix start time initialization in SDK
All checks were successful
Deploy to Production / deploy (push) Successful in 8s

This commit is contained in:
Đặng Minh Quang
2026-02-27 17:41:07 +07:00
parent c207195e52
commit 08d31f085f
5 changed files with 10 additions and 11 deletions

View File

@@ -25622,10 +25622,10 @@ cr.getObjectRefTable = function () { return [
cr.plugins_.Audio,
cr.plugins_.Browser,
cr.plugins_.Function,
cr.plugins_.Sprite,
cr.plugins_.SenaPlugin,
cr.plugins_.Text,
cr.plugins_.Sprite,
cr.plugins_.Touch,
cr.plugins_.Text,
cr.behaviors.Rex_MoveTo,
cr.behaviors.lunarray_Tween,
cr.behaviors.Anchor,

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
{
"version": 1772167673,
"version": 1772188569,
"fileList": [
"data.js",
"c2runtime.js",
@@ -9,9 +9,6 @@
"images/close_btn-sheet0.png",
"images/startbg-sheet0.png",
"images/sound_btn-sheet0.png",
"images/back_btn-sheet0.png",
"images/next_btn-sheet0.png",
"images/shuffle-sheet0.png",
"images/logo-sheet0.png",
"images/dim-sheet0.png",
"images/koala-sheet0.png",

View File

@@ -155,7 +155,7 @@ SenaSDK.prototype.loadFromPostMessage = function (inputJson, callback) {
// Lưu trữ danh sách gốc
self.masterList = [...self.data.options];
// Tính tổng số level
self.totalLevels = Math.ceil(self.masterList.length / self.itemCount);
self.totalLevels = Math.ceil(self.masterList.length / 6);
self.currentLevel = 0;
// Load Level 1 ngay lập tức để self.data.options chỉ chứa 6 card đầu
@@ -519,7 +519,7 @@ SenaSDK.prototype._loadFromServer = function (
// Lưu trữ danh sách gốc
self.masterList = [...self.data.options];
// Tính tổng số level
self.totalLevels = Math.ceil(self.masterList.length / self.itemCount);
self.totalLevels = Math.ceil(self.masterList.length / 6);
self.currentLevel = 0;
// Load Level 1 ngay lập tức để self.data.options chỉ chứa 6 card đầu
@@ -1038,6 +1038,9 @@ SenaSDK.prototype.getHintValue = function (index) {
SenaSDK.prototype.start = function () {
let self = this;
// LUÔN GÁN THỜI GIAN BẮT ĐẦU Ở ĐÂY
self.startTime = Date.now();
// Nếu là matching game, forward sang tdv_sdk.start()
if (self.isMatchingGame) {
console.log("🎮 Sena SDK: Matching game - forwarding start() to tdv_sdk");
@@ -1052,7 +1055,6 @@ SenaSDK.prototype.start = function () {
if (self.shuffle && self.data && self.data.options) {
self.shuffleArray(self.data.options);
}
self.startTime = Date.now();
// Additional logic for tracking can be added here if needed
};
@@ -1734,7 +1736,7 @@ SenaSDK.prototype.loadLevelG5 = function (levelIndex) {
if (self.gameType !== 5 || !self.masterList) return false;
self.currentLevel = levelIndex;
let count = self.itemCount; // Số card tối đa mỗi trang (VD: 6)
let count = 6; // Khóa cứng max 6 card/trang cho G5
window.Sena_TotalLevels = Math.ceil(self.masterList.length / count);

Binary file not shown.