Apple Watch için oyun geliştirin

Digital Crown ile bir işaretçiyi hareket ettirin. Saat her kareyi runGame ile iletir.

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);
});

Bugünkü durum

watchOS’te Canvas 2B, SceneKit 3B çizer. Jolt fiziği ve masaüstü ertelenmiş işleyicisi kullanılamaz.

Sorular ve yanıtlar

Saatimde yayımlanmış bir oyunu deneyebilir miyim?

Bloom Jump Watch’un App Store’da kendi sayfası var.

Kaynaklar