# ネイティブゲーム向け TypeScript ゲームエンジン

ウィンドウを開き、毎フレーム図形を描きます。Perry がゲームをコンパイルし、Bloom のネイティブライブラリをリンクします。

main.ts

```
import { initWindow, runGame, clearBackground, Colors } from "@bloomengine/engine";
import { drawCircle } from "@bloomengine/engine/shapes";

initWindow(640, 360, "Bloom");
runGame(() => {
  clearBackground(Colors.BLACK);
  drawCircle(320, 180, 16, Colors.GREEN);
});
```

## 現在の対応状況

デスクトップ向けには Rust と Perry が必要です。初回ビルドで対象環境用のエンジンをコンパイルします。

## よくある質問

### 同じループをブラウザーで使えますか？

runGame にコールバックを渡してください。Web ビルドは WebAssembly を出力し、wasm-pack を使用します。

## 出典

*   [Bloom API](https://bloomengine.dev/docs#quick-start)
*   [WebAssembly](https://github.com/Bloom-Engine/engine/blob/main/docs/web-target.md)
