# Loop game bergaya raylib di TypeScript

Panggil fungsi gambar di antara beginDrawing dan endDrawing. Bloom menyediakan warna, bentuk, dan input melalui TypeScript.

main.ts

```
import { initWindow, windowShouldClose, beginDrawing, endDrawing,
  clearBackground, closeWindow, Colors } from "@bloomengine/engine";
import { drawRect } from "@bloomengine/engine/shapes";

initWindow(640, 360, "Bloom");
while (!windowShouldClose()) {
  beginDrawing();
  clearBackground(Colors.SNOW);
  drawRect(48, 48, 96, 64, Colors.GREEN);
  endDrawing();
}
closeWindow();
```

## Status saat ini

Bloom mengimplementasikan renderer dan API sendiri. Saat memindahkan panggilan dan struktur C, periksa tanda tangan fungsi Bloom satu per satu.

## Tanya jawab

### Bisakah saya langsung memakai plugin C raylib?

Bloom tidak menautkan raylib. Kode yang membutuhkan handle native raylib memerlukan integrasi terpisah.

[Pindahkan game raylib ke TypeScript](https://bloomengine.dev/id/alternatives/raylib-typescript)

## Sumber

*   [Bloom API](https://github.com/Bloom-Engine/engine#how-bloom-relates-to-raylib)
*   [raylib](https://www.raylib.com/cheatsheet/cheatsheet.html)
