สร้างเกมสำหรับ Apple Watch

หมุน Digital Crown เพื่อเลื่อนจุดบนหน้าจอ นาฬิกาส่งแต่ละเฟรมผ่าน runGame

main.ts
import { initWindow, runGame, clearBackground, Colors } from "@bloomengine/engine";
import { getCrownRotation, getScreenWidth } from "@bloomengine/engine/core";
import { drawCircle } from "@bloomengine/engine/shapes";

initWindow(180, 180, "Bloom");
let x = 90;
runGame(() => {
  x = Math.max(8, Math.min(getScreenWidth() - 8, x + getCrownRotation() * 20));
  clearBackground(Colors.BLACK);
  drawCircle(x, 90, 8, Colors.GREEN);
});

สถานะปัจจุบัน

บน watchOS ใช้ Canvas วาด 2 มิติ และ SceneKit วาด 3 มิติ ไม่รองรับฟิสิกส์ Jolt และตัวเรนเดอร์แบบ deferred ของเดสก์ท็อป

คำถามที่พบบ่อย

มีเกมที่เผยแพร่แล้วให้ลองบนนาฬิกาไหม

Bloom Jump Watch มีหน้าของตัวเองใน App Store

แหล่งข้อมูล