# 面向编程智能体的 Bloom Engine

Bloom 是 TypeScript 游戏引擎。Perry 编译原生版本，Web 目标使用 WebAssembly。

引擎许可证 · [MIT](https://github.com/Bloom-Engine/engine/blob/main/LICENSE)

## 在 macOS 上安装

Node.js · Rust · Xcode Command Line Tools

```
npm init -y
npm install -D @perryts/perry@0.5.1665
npm install @bloomengine/engine@0.4.19
npm pkg set 'perry.allow.nativeLibrary[0]=@bloomengine/*'
```

[main.ts](https://bloomengine.dev/docs#quick-start)

```
npx perry compile main.ts -o game && ./game
```

## 平台和图形 API

**macOS**
 Metal

**Windows**
 DirectX 12

**Linux**
 Vulkan / OpenGL

**iOS**
 Metal

**tvOS**
 Metal

**watchOS**
 SwiftUI Canvas / SceneKit

**visionOS**
 Metal

**Android**
 Vulkan / OpenGL ES

**Web**
 WebGPU / WebGL

## API 模块 · 0.4.19

**[`core`](https://bloomengine.dev/docs#core)**
 窗口创建、游戏循环、输入处理、计时与帧控制。

**[`shapes`](https://bloomengine.dev/docs#shapes)**
 2D 图形绘制 —— 直线、矩形、圆形、多边形 —— 以及碰撞检测。

**[`textures`](https://bloomengine.dev/docs#textures)**
 图像加载、纹理管理、精灵批处理与渲染到纹理。

**[`text`](https://bloomengine.dev/docs#text)**
 TTF 与 OTF 字体加载、文本渲染与度量。

**[`audio`](https://bloomengine.dev/docs#audio)**
 音效、音乐流播放、3D 位置音频,支持 WAV / OGG / MP3。

**[`models`](https://bloomengine.dev/docs#models)**
 glTF 2.0 加载、GPU 骨骼动画、PBR 材质、网格基本体。

**[`math`](https://bloomengine.dev/docs#math)**
 向量、矩阵、四元数、缓动函数与随机数生成。

**[`physics`](https://bloomengine.dev/docs#physics)**
 由 Jolt 驱动的刚体与软体、角色控制器、载具、射线检测、约束。

**[`scene`](https://bloomengine.dev/docs#scene)**
 保留模式场景图 —— 变换、可见性、阴影、材质绑定。

**[`mobile`](https://bloomengine.dev/docs#mobile)**
 虚拟控件、安全区域与触控输入辅助。

**[`world`](https://bloomengine.dev/docs#world)**
 带版本的世界加载与验证、预制体和运行时实例化。

**[`vfx`](https://bloomengine.dev/docs#vfx)**
 GPU 粒子系统、发射器与贴花。

**[`quality`](https://bloomengine.dev/docs#quality)**
 确定性的质量测试、截图与遥测。

## 文档索引

[文档](https://bloomengine.dev/docs) · [游戏模板](https://bloomengine.dev/zh-Hans/templates) · [llms-full.txt](https://bloomengine.dev/llms-full.txt)
