Browse Source

no message

student 1 tuần trước cách đây
mục cha
commit
4d1fc029ba
16 tập tin đã thay đổi với 72 bổ sung121 xóa
  1. 0 0
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/data.json
  2. BIN
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/images/block1a-sheet0.webp
  3. BIN
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/images/btn_lvl-sheet0.webp
  4. BIN
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/images/cats-sheet1.webp
  5. BIN
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/images/sprite3-sheet0.webp
  6. BIN
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/images/sprite3-sheet1.webp
  7. BIN
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/images/sprite3-sheet2.webp
  8. 1 1
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/offline.json
  9. 1 2
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/scripts/objRefTable.js
  10. 62 72
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/scripts/project/main.js
  11. 0 0
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/data.json
  12. 1 1
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/offline.json
  13. 0 4
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/scripts/c3runtime.js
  14. 0 1
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/scripts/objRefTable.js
  15. 7 40
      Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/scripts/project/main.js
  16. BIN
      Kitty_Fall/catpuzzle_aquang.zip

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/data.json


BIN
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/images/block1a-sheet0.webp


BIN
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/images/btn_lvl-sheet0.webp


BIN
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/images/cats-sheet1.webp


BIN
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/images/sprite3-sheet0.webp


BIN
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/images/sprite3-sheet1.webp


BIN
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/images/sprite3-sheet2.webp


+ 1 - 1
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/offline.json

@@ -1 +1 @@
-{"version":1784690715561,"fileList":["scripts/main.js","scripts/c3runtime.js","scripts/objRefTable.js","scripts/project/main.js","scripts/c3main.js","scripts/dispatchworker.js","scripts/jobworker.js","data.json","scripts/modernjscheck.js","scripts/supportcheck.js","scripts/offlineclient.js","icons/loading-logo.png","icons/icon-16.png","icons/icon-32.png","icons/icon-64.png","icons/icon-128.png","icons/icon-256.png","icons/icon-512.png","media/congratulations.webm","media/click.webm","media/Button03.webm","media/cute-cat-352656.webm","media/win2.webm","media/timeup_.webm","media/click_sound.webm","media/playground.webm","box2d.wasm.js","box2d.wasm","style.css","images/shared-0-sheet0.webp","images/shared-0-sheet1.webp","images/shared-0-sheet2.webp","images/shared-0-sheet3.webp","images/shared-0-sheet4.webp","images/shared-0-sheet5.webp","images/shared-0-sheet6.webp","images/block1a-sheet0.webp","images/block1a-sheet1.webp","images/cats-sheet0.webp","images/cats-sheet1.webp","images/cats-sheet2.webp","images/cats-sheet3.webp","images/cats-sheet4.webp","images/confettix-sheet0.webp","images/confettix-sheet1.webp","images/sprite3-sheet0.webp","images/sprite3-sheet1.webp","images/sprite3-sheet2.webp","images/scroll-sheet0.webp","images/btn_lvl-sheet0.webp","images/btn_lvl-sheet1.webp","scripts/register-sw.js"]}
+{"version":1784775413574,"fileList":["scripts/main.js","scripts/c3runtime.js","scripts/objRefTable.js","scripts/project/main.js","scripts/c3main.js","scripts/dispatchworker.js","scripts/jobworker.js","data.json","scripts/modernjscheck.js","scripts/supportcheck.js","scripts/offlineclient.js","icons/loading-logo.png","icons/icon-16.png","icons/icon-32.png","icons/icon-64.png","icons/icon-128.png","icons/icon-256.png","icons/icon-512.png","media/congratulations.webm","media/click.webm","media/Button03.webm","media/cute-cat-352656.webm","media/win2.webm","media/timeup_.webm","media/click_sound.webm","media/playground.webm","box2d.wasm.js","box2d.wasm","style.css","images/scroll-sheet0.webp","images/shared-0-sheet6.webp","images/shared-0-sheet3.webp","images/shared-0-sheet0.webp","images/shared-0-sheet5.webp","images/shared-0-sheet4.webp","images/shared-0-sheet2.webp","images/confettix-sheet0.webp","images/confettix-sheet1.webp","images/cats-sheet0.webp","images/shared-0-sheet1.webp","images/cats-sheet2.webp","images/btn_lvl-sheet0.webp","images/btn_lvl-sheet1.webp","images/cats-sheet1.webp","images/cats-sheet4.webp","images/cats-sheet3.webp","images/block1a-sheet1.webp","images/block1a-sheet0.webp","images/sprite3-sheet0.webp","images/sprite3-sheet1.webp","images/sprite3-sheet2.webp","scripts/register-sw.js"]}

+ 1 - 2
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/scripts/objRefTable.js

@@ -113,8 +113,7 @@ self.C3_GetObjectRefTable = function () {
 		C3.Plugins.LocalStorage.Cnds.OnItemMissing,
 		C3.Plugins.LocalStorage.Cnds.OnItemGet,
 		C3.Plugins.LocalStorage.Exps.ItemValue,
-		C3.Plugins.Sprite.Acts.SetAnim,
-		C3.Plugins.LocalStorage.Acts.CheckItemExists
+		C3.Plugins.Sprite.Acts.SetAnim
 	];
 };
 self.C3_JsPropNameTable = [

+ 62 - 72
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle - Copy/scripts/project/main.js

@@ -7,11 +7,6 @@ let lastExitGame=false;
 let lastLevelCompleted = 0;
 let lastGameOver = 0;
 
-// Keep the server-provided daily level separate from Construct Local Storage.
-// The event sheet may enter its "missing" branch after startup and repaint all
-// menu buttons as locked even though max_level was read correctly from the URL.
-let dailyMaxLevelFromUrl = 1;
-
 runOnStartup(async runtime =>
 {
 	runtime.addEventListener(
@@ -43,19 +38,6 @@ async function OnBeforeProjectStart(runtime)
 		() => Tick(runtime)
 	);
 
-	// Apply after the event sheet so its Local Storage fallback cannot overwrite
-	// the level state supplied by the website for the current subscriber/day.
-	runtime.addEventListener(
-		"tick2",
-		() =>
-		{
-			// Level buttons only exist on the menu. Do not run the menu sync
-			// while an Easy/Medium/Hard gameplay layout is active.
-			if (runtime.layout?.name === "Menu")
-				SyncDailyLevelMenu(runtime);
-		}
-	);
-
 	console.log("Add event success");
 
 	// Báo MVC biết game đã sẵn sàng
@@ -71,31 +53,6 @@ async function OnBeforeProjectStart(runtime)
 }
 
 
-function SyncDailyLevelMenu(runtime)
-{
-	const levelButtons = runtime.objects.btn_lvl?.getAllInstances() ?? [];
-
-	for (const button of levelButtons)
-	{
-		const level = Number(button.instVars.level);
-		if (!Number.isFinite(level))
-			continue;
-
-		const isOpen = level <= dailyMaxLevelFromUrl;
-		const animation = isOpen ? "open" : "locked";
-
-		if (button.animationName !== animation)
-			button.setAnimation(animation);
-
-		// The open animation contains one frame per menu number (1-50).
-		// Selecting the animation resets it to frame 0, so restore the frame
-		// that belongs to this button's level after changing its lock state.
-		if (isOpen && button.animationFrame !== level - 1)
-			button.animationFrame = level - 1;
-	}
-}
-
-
 
 function LoadGameConfigFromUrl(runtime)
 {
@@ -105,23 +62,33 @@ function LoadGameConfigFromUrl(runtime)
 			window.location.search
 		);
 
-		const requestedGameType = params.get("gameType");
-		const requestedMaxLevel = Number.parseInt(params.get("max_level"), 10);
+		const gameType =
+			params.get("gameType");
+
+
+		if (gameType)
+		{
+			runtime.globalVars.gameType = gameType;
+		}
+		else
+		{
+			runtime.globalVars.gameType = "Easy";
+		}
+
 
-		// Website calculates today's progress for the current subscriber and
-		// passes it in the iframe URL. Apply both values before the menu event
-		// sheet starts, so the game does not briefly use Easy/local progress.
-		runtime.globalVars.gameType = ["Easy", "Medium", "Hard"].includes(requestedGameType)
-			? requestedGameType
-			: "Easy";
+		const maxLevel = parseInt(params.get("max_level"), 10);
 
-		runtime.globalVars.unlocked_level = Number.isFinite(requestedMaxLevel)
-			? Math.min(50, Math.max(1, requestedMaxLevel))
-			: 1;
-		dailyMaxLevelFromUrl = runtime.globalVars.unlocked_level;
+		if (Number.isInteger(maxLevel) && maxLevel >= 1)
+		{
+			runtime.globalVars.unlocked_level = maxLevel;
+		}
+		else
+		{
+			runtime.globalVars.unlocked_level = 1;
+		}
 
-		runtime.globalVars.InitGameTypeSuccess = 1;
-		runtime.globalVars.InitUnLockSucess = 1;
+
+		runtime.globalVars.InitGameTypeSuccess =1;
 
 		// Sau khi có gameType thì set cấu hình game
 		SetGameConfig(runtime);
@@ -130,10 +97,10 @@ function LoadGameConfigFromUrl(runtime)
 		console.log(
 			"GameType:",
 			runtime.globalVars.gameType,
-			"MaxLevel:",
-			runtime.globalVars.unlocked_level,
 			"TotalTime:",
-			runtime.globalVars.totaltime
+			runtime.globalVars.totaltime,
+			"max_level:",
+			runtime.globalVars.unlocked_level
 		);
 
 	}
@@ -145,10 +112,6 @@ function LoadGameConfigFromUrl(runtime)
 		);
 
 		runtime.globalVars.gameType = "Easy";
-		runtime.globalVars.unlocked_level = 1;
-		dailyMaxLevelFromUrl = 1;
-		runtime.globalVars.InitGameTypeSuccess = 1;
-		runtime.globalVars.InitUnLockSucess = 1;
 
 		SetGameConfig(runtime);
 	}
@@ -304,6 +267,14 @@ function Tick(runtime)
 //Set showPrizePopup = 0
 async function SaveLevelResult(runtime)
 {
+	if (levelSending)
+	{
+		console.warn("SaveLevelResult ignored because a request is already in progress.");
+		return;
+	}
+
+	levelSending = true;
+
 	try
 	{
 		console.log("Calling SaveLevelResult...");
@@ -318,8 +289,6 @@ async function SaveLevelResult(runtime)
 			gameOver: 0
 		};
 
-		console.log("Request Body:", body);
-
 		const response = await fetch(
 			runtime.globalVars.root + "/Game/SaveLevelResult",
 			{
@@ -335,10 +304,19 @@ async function SaveLevelResult(runtime)
 
 		console.log("Level Result:", result);
 
+		if (!response.ok || result.success !== true)
+		{
+			throw new Error(result.message || `Save level failed (${response.status})`);
+		}
+
 		// Lưu dữ liệu gốc
-		runtime.globalVars.point = Number(result.point ?? 0);
-		runtime.globalVars.data = Number(result.data ?? 0);
-		runtime.globalVars.score = Number(result.score ?? 0);
+		const point = Number(result.point ?? 0);
+		const data = Number(result.data ?? 0);
+		const score = Number(result.score ?? 0);
+
+		runtime.globalVars.point = Number.isFinite(point) ? point : 0;
+		runtime.globalVars.data = Number.isFinite(data) ? data : 0;
+		runtime.globalVars.score = Number.isFinite(score) ? score : 0;
 		runtime.globalVars.transId = result.transId ?? "";
 
 		// Xác định phần thưởng
@@ -348,19 +326,30 @@ async function SaveLevelResult(runtime)
 		if (runtime.globalVars.point > 0)
 		{
 			runtime.globalVars.gGiftValues = runtime.globalVars.point;
-			runtime.globalVars.gGiftText = "POINTS";
+			runtime.globalVars.gGiftText = "Loyalty";
 		}
 		else if (runtime.globalVars.data > 0)
 		{
 			runtime.globalVars.gGiftValues = runtime.globalVars.data;
-			runtime.globalVars.gGiftText = "DATA";
+			runtime.globalVars.gGiftText = "M";
 		}
 		else if (runtime.globalVars.score > 0)
 		{
 			runtime.globalVars.gGiftValues = runtime.globalVars.score;
-			runtime.globalVars.gGiftText = "SCORE";
+			runtime.globalVars.gGiftText = "Score";
 		}
 
+		// Update the visible fields immediately as well as notifying the event sheet.
+		// This prevents one stale frame when the response arrives between game ticks.
+		const giftValueText = runtime.objects.txtGiftValues?.getFirstInstance();
+		const giftTypeText = runtime.objects.txtGiftText?.getFirstInstance();
+
+		if (giftValueText)
+			giftValueText.text = String(runtime.globalVars.gGiftValues);
+
+		if (giftTypeText)
+			giftTypeText.text = runtime.globalVars.gGiftText;
+
 		runtime.globalVars.showPrizePopup = 1;
 
 		console.log("Gift Type:", runtime.globalVars.gGiftText);
@@ -523,3 +512,4 @@ function MovePlayer(offsetX, offsetY)
     player.x += offsetX;
     player.y += offsetY;
 }
+

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/data.json


+ 1 - 1
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/offline.json

@@ -1 +1 @@
-{"version":1784775413574,"fileList":["scripts/main.js","scripts/c3runtime.js","scripts/objRefTable.js","scripts/project/main.js","scripts/c3main.js","scripts/dispatchworker.js","scripts/jobworker.js","data.json","scripts/modernjscheck.js","scripts/supportcheck.js","scripts/offlineclient.js","icons/loading-logo.png","icons/icon-16.png","icons/icon-32.png","icons/icon-64.png","icons/icon-128.png","icons/icon-256.png","icons/icon-512.png","media/congratulations.webm","media/click.webm","media/Button03.webm","media/cute-cat-352656.webm","media/win2.webm","media/timeup_.webm","media/click_sound.webm","media/playground.webm","box2d.wasm.js","box2d.wasm","style.css","images/scroll-sheet0.webp","images/shared-0-sheet6.webp","images/shared-0-sheet3.webp","images/shared-0-sheet0.webp","images/shared-0-sheet5.webp","images/shared-0-sheet4.webp","images/shared-0-sheet2.webp","images/confettix-sheet0.webp","images/confettix-sheet1.webp","images/cats-sheet0.webp","images/shared-0-sheet1.webp","images/cats-sheet2.webp","images/btn_lvl-sheet0.webp","images/btn_lvl-sheet1.webp","images/cats-sheet1.webp","images/cats-sheet4.webp","images/cats-sheet3.webp","images/block1a-sheet1.webp","images/block1a-sheet0.webp","images/sprite3-sheet0.webp","images/sprite3-sheet1.webp","images/sprite3-sheet2.webp","scripts/register-sw.js"]}
+{"version":1784790149579,"fileList":["scripts/main.js","scripts/c3runtime.js","scripts/objRefTable.js","scripts/project/main.js","scripts/c3main.js","scripts/dispatchworker.js","scripts/jobworker.js","data.json","scripts/modernjscheck.js","scripts/supportcheck.js","scripts/offlineclient.js","icons/loading-logo.png","icons/icon-16.png","icons/icon-32.png","icons/icon-64.png","icons/icon-128.png","icons/icon-256.png","icons/icon-512.png","media/congratulations.webm","media/click.webm","media/Button03.webm","media/cute-cat-352656.webm","media/win2.webm","media/timeup_.webm","media/click_sound.webm","media/playground.webm","box2d.wasm.js","box2d.wasm","style.css","images/shared-0-sheet0.webp","images/shared-0-sheet1.webp","images/shared-0-sheet2.webp","images/shared-0-sheet3.webp","images/shared-0-sheet4.webp","images/shared-0-sheet5.webp","images/shared-0-sheet6.webp","images/block1a-sheet0.webp","images/block1a-sheet1.webp","images/cats-sheet0.webp","images/cats-sheet1.webp","images/cats-sheet2.webp","images/cats-sheet3.webp","images/cats-sheet4.webp","images/confettix-sheet0.webp","images/confettix-sheet1.webp","images/sprite3-sheet0.webp","images/sprite3-sheet1.webp","images/sprite3-sheet2.webp","images/scroll-sheet0.webp","images/btn_lvl-sheet0.webp","images/btn_lvl-sheet1.webp","scripts/register-sw.js"]}

+ 0 - 4
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/scripts/c3runtime.js

@@ -1670,10 +1670,6 @@ self.C3_ExpressionFuncs = [
 		() => 0.95,
 		() => "sizeback",
 		() => 0.5,
-		p => {
-			const v0 = p._GetNode(0).GetVar();
-			return () => (("Ghi thành cong " + v0.GetValue()) + "_unlocked_level");
-		},
 		() => "help",
 		() => "Sound programming",
 		() => "music",

+ 0 - 1
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/scripts/objRefTable.js

@@ -96,7 +96,6 @@ self.C3_GetObjectRefTable = function () {
 		C3.Plugins.Browser.Acts.ConsoleLog,
 		C3.Plugins.System.Acts.RestartLayout,
 		C3.Plugins.Sprite.Acts.SetScale,
-		C3.Plugins.LocalStorage.Cnds.OnItemSet,
 		C3.Plugins.Touch.Cnds.OnTouchStart,
 		C3.Plugins.Audio.Acts.SetMasterVolume,
 		C3.Plugins.Audio.Cnds.IsTagPlaying,

+ 7 - 40
Kitty_Fall/Kitty_Fall/Kitty_Fall.Website/wwwroot/catpuzzle/scripts/project/main.js

@@ -250,11 +250,6 @@ function Tick(runtime)
         lastExitGame = 0;
     }
 
-
-
-
-
-
 }
 
 
@@ -267,14 +262,6 @@ function Tick(runtime)
 //Set showPrizePopup = 0
 async function SaveLevelResult(runtime)
 {
-	if (levelSending)
-	{
-		console.warn("SaveLevelResult ignored because a request is already in progress.");
-		return;
-	}
-
-	levelSending = true;
-
 	try
 	{
 		console.log("Calling SaveLevelResult...");
@@ -289,6 +276,8 @@ async function SaveLevelResult(runtime)
 			gameOver: 0
 		};
 
+		console.log("Request Body:", body);
+
 		const response = await fetch(
 			runtime.globalVars.root + "/Game/SaveLevelResult",
 			{
@@ -304,19 +293,10 @@ async function SaveLevelResult(runtime)
 
 		console.log("Level Result:", result);
 
-		if (!response.ok || result.success !== true)
-		{
-			throw new Error(result.message || `Save level failed (${response.status})`);
-		}
-
 		// Lưu dữ liệu gốc
-		const point = Number(result.point ?? 0);
-		const data = Number(result.data ?? 0);
-		const score = Number(result.score ?? 0);
-
-		runtime.globalVars.point = Number.isFinite(point) ? point : 0;
-		runtime.globalVars.data = Number.isFinite(data) ? data : 0;
-		runtime.globalVars.score = Number.isFinite(score) ? score : 0;
+		runtime.globalVars.point = Number(result.point ?? 0);
+		runtime.globalVars.data = Number(result.data ?? 0);
+		runtime.globalVars.score = Number(result.score ?? 0);
 		runtime.globalVars.transId = result.transId ?? "";
 
 		// Xác định phần thưởng
@@ -339,17 +319,6 @@ async function SaveLevelResult(runtime)
 			runtime.globalVars.gGiftText = "Score";
 		}
 
-		// Update the visible fields immediately as well as notifying the event sheet.
-		// This prevents one stale frame when the response arrives between game ticks.
-		const giftValueText = runtime.objects.txtGiftValues?.getFirstInstance();
-		const giftTypeText = runtime.objects.txtGiftText?.getFirstInstance();
-
-		if (giftValueText)
-			giftValueText.text = String(runtime.globalVars.gGiftValues);
-
-		if (giftTypeText)
-			giftTypeText.text = runtime.globalVars.gGiftText;
-
 		runtime.globalVars.showPrizePopup = 1;
 
 		console.log("Gift Type:", runtime.globalVars.gGiftText);
@@ -359,10 +328,6 @@ async function SaveLevelResult(runtime)
 	{
 		console.error("SaveLevelResult Error:", error);
 	}
-	finally
-	{
-		levelSending = false;
-	}
 }
 
 
@@ -513,3 +478,5 @@ function MovePlayer(offsetX, offsetY)
     player.y += offsetY;
 }
 
+
+

BIN
Kitty_Fall/catpuzzle_aquang.zip


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác