SDK สำหรับนักพัฒนาซอฟต์แวร์ GameSnacks
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
GameSnacks Developer SDK มีฟีเจอร์ต่างๆ สำหรับเกมที่โฮสต์ใน GameSnacks
คุณไม่จำเป็นต้องโหลดสคริปต์ใดๆ ระบบจะโหลด SDK โดยอัตโนมัติสำหรับ
เกมที่โฮสต์ใน GameSnacks
อินเทอร์เฟซ GameSnacks
อินเทอร์เฟซหลัก ตัวอย่างนี้ใช้ได้กับ GameSnacks
ใน window
ฟีเจอร์ที่ทำเครื่องหมายว่าจำเป็นต้องผสานรวมเข้ากับเกมของคุณโดยทำตามสิ่งต่อไปนี้
ตามที่ระบุไว้ภายในฟีเจอร์เหล่านี้
พร็อพเพอร์ตี้
ad: Ad
วิธีการแสดงโฆษณาในเกม ต้องระบุ
audio: Audio
วิธีควบคุมเสียง ต้องระบุ
game: Game
เหตุการณ์ในวงจรของเกมและการควบคุมการหยุดชั่วคราว ต้องระบุ
score: Score
วิธีการอัปเดตคะแนนของผู้ใช้ ต้องระบุ
storage: Storage
วิธีการคงเกมไว้และบันทึกข้อมูล ต้องระบุ
ตัวอย่าง
// Register lifecycle event handlers.
GameSnacks.game.onPause(() => {
// Display pause screen.
engine.scene("pauseScreen").setVisible();
// Pause game loop.
engine.loop.sleep();
});
GameSnacks.game.onResume(...);
// Set up audio controls.
engine.sound.setMute(!GameSnacks.audio.isEnabled);
GameSnacks.audio.subscribe((isEnabled) => engine.sound.setMute(!isEnabled));
// Announce that the game is ready to be shown.
GameSnacks.game.firstFrameReady();
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-25 UTC"],[[["The GameSnacks Developer SDK automatically loads and provides essential features for games hosted on the platform."],["Games must integrate the required features: advertising, audio controls, game lifecycle management, score updates, and data storage."],["The SDK offers a straightforward interface through the `GameSnacks` global object, granting access to functionalities like displaying ads or controlling the game's audio."],["Developers can utilize the provided methods and event handlers to seamlessly integrate their games with the GameSnacks platform."]]],[]]