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
All checks were successful
Deploy to Production / deploy (push) Successful in 8s
This commit is contained in:
@@ -25622,10 +25622,10 @@ cr.getObjectRefTable = function () { return [
|
|||||||
cr.plugins_.Audio,
|
cr.plugins_.Audio,
|
||||||
cr.plugins_.Browser,
|
cr.plugins_.Browser,
|
||||||
cr.plugins_.Function,
|
cr.plugins_.Function,
|
||||||
cr.plugins_.Sprite,
|
|
||||||
cr.plugins_.SenaPlugin,
|
cr.plugins_.SenaPlugin,
|
||||||
cr.plugins_.Text,
|
cr.plugins_.Sprite,
|
||||||
cr.plugins_.Touch,
|
cr.plugins_.Touch,
|
||||||
|
cr.plugins_.Text,
|
||||||
cr.behaviors.Rex_MoveTo,
|
cr.behaviors.Rex_MoveTo,
|
||||||
cr.behaviors.lunarray_Tween,
|
cr.behaviors.lunarray_Tween,
|
||||||
cr.behaviors.Anchor,
|
cr.behaviors.Anchor,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": 1772167673,
|
"version": 1772188569,
|
||||||
"fileList": [
|
"fileList": [
|
||||||
"data.js",
|
"data.js",
|
||||||
"c2runtime.js",
|
"c2runtime.js",
|
||||||
@@ -9,9 +9,6 @@
|
|||||||
"images/close_btn-sheet0.png",
|
"images/close_btn-sheet0.png",
|
||||||
"images/startbg-sheet0.png",
|
"images/startbg-sheet0.png",
|
||||||
"images/sound_btn-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/logo-sheet0.png",
|
||||||
"images/dim-sheet0.png",
|
"images/dim-sheet0.png",
|
||||||
"images/koala-sheet0.png",
|
"images/koala-sheet0.png",
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ SenaSDK.prototype.loadFromPostMessage = function (inputJson, callback) {
|
|||||||
// Lưu trữ danh sách gốc
|
// Lưu trữ danh sách gốc
|
||||||
self.masterList = [...self.data.options];
|
self.masterList = [...self.data.options];
|
||||||
// Tính tổng số level
|
// 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;
|
self.currentLevel = 0;
|
||||||
|
|
||||||
// Load Level 1 ngay lập tức để self.data.options chỉ chứa 6 card đầu
|
// 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
|
// Lưu trữ danh sách gốc
|
||||||
self.masterList = [...self.data.options];
|
self.masterList = [...self.data.options];
|
||||||
// Tính tổng số level
|
// 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;
|
self.currentLevel = 0;
|
||||||
|
|
||||||
// Load Level 1 ngay lập tức để self.data.options chỉ chứa 6 card đầu
|
// 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 () {
|
SenaSDK.prototype.start = function () {
|
||||||
let self = this;
|
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()
|
// Nếu là matching game, forward sang tdv_sdk.start()
|
||||||
if (self.isMatchingGame) {
|
if (self.isMatchingGame) {
|
||||||
console.log("🎮 Sena SDK: Matching game - forwarding start() to tdv_sdk");
|
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) {
|
if (self.shuffle && self.data && self.data.options) {
|
||||||
self.shuffleArray(self.data.options);
|
self.shuffleArray(self.data.options);
|
||||||
}
|
}
|
||||||
self.startTime = Date.now();
|
|
||||||
// Additional logic for tracking can be added here if needed
|
// 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;
|
if (self.gameType !== 5 || !self.masterList) return false;
|
||||||
|
|
||||||
self.currentLevel = levelIndex;
|
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);
|
window.Sena_TotalLevels = Math.ceil(self.masterList.length / count);
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user