aiohttp
免费Use when building Python async HTTP services or clients with aiohttp - web server routing, middleware, WebSocket, SSE, streaming, client sessions, pytest-aiohttp testing, or troubleshooting SSL and timeout issues
中文简介正在准备中。当前显示原文说明。
Use when building GBA games with the BPCore Lua engine - entity, sprite and tilemap functions, SRAM save and load, link cable multiplayer protocol, camera and scrolling, or optimization patterns
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Comprehensive guide for building Gameboy Advance games using the BPCore Engine Lua framework.
BPCore Engine (Blind jumP Core Engine) is a Lua game framework for GBA that combines C++ with embedded Lua, letting developers create games without C++ or compilers. Inspired by Pico-8 and Tic80, it's suited for small minigames given the GBA's limited resources: 240x160 screen, 16.78 MHz ARM7TDMI, and 256KB RAM for Lua/data.
The engine provides sprite rendering, tile-based graphics, entity management with collision, button input, UTF-8 text, audio, save/load via SRAM, and multiplayer through the link cable. The build system uses Lua to package resources into ROM.
| Function | Signature | Description |
|---|---|---|
ent() | ent() | Create entity, returns handle |
entpos(e, x, y) | entpos(e, x, y) | Set position, returns self |
entz(e, z) | entz(e, z) | Set Z-order (0-255), returns self |
entspr(e, sprite, xflip, yflip) | entspr(e, sprite, xflip, yflip) | Set sprite and flips, returns self |
entspd(e, x, y) | entspd(e, x, y) | Set movement speed, returns self |
entslot(e, slot, value) | entslot(e, slot, value) | Store in slot, returns self |
entslots(e, count) | entslots(e, count) | Allocate slots, returns self |
entanim(e, start, len, rate) | entanim(e, start, len, rate) | Set animation |
entag(e, tag) | entag(e, tag) | Set collision tag, returns self |
enthb(e, ox, oy, w, h) | enthb(e, ox, oy, w, h) | Set hitbox, returns self |
del(e, auto?) | del(e, [auto]) | Delete entity |
ents() | ents() | Get all entities table |
| Function | Signature | Description |
|---|---|---|
txtr(layer_id, filename) | txtr(layer_id, filename) | Load texture from file |
txtr(layer_id, ptr, len) | txtr(layer_id, ptr, len) | Load from pointer/length |
file(filename) | file(filename) | Get file pointer/length |
spr(sprite_id, x, y) | spr(sprite_id, x, y) | Draw sprite |
spr(sprite_id, x, y, xflip, yflip) | spr(sprite_id, x, y, xflip, yflip) | Draw with flips |
tile(layer_id, x, y, num?) | tile(layer_id, x, y, [num]) | Draw/read tile |
tilemap(f, layer, w, h, dx, dy, sx, sy) | tilemap(f, layer, w, h, dx, dy, sx, sy) | Load CSV tilemap |
clear() | clear() | Clear sprites, VSync |
display() | display() | Send sprites to display |
fade(amount, color?, tl?, bg?) | fade(amount, [color], [tl], [bg]) | Fade layers |
| Function | Signature | Description |
|---|---|---|
camera(x, y) | camera(x, y) | Set camera center |
scroll(layer, x, y) | scroll(layer, x, y) | Set layer scroll |
priority(s, bg, t0, t1) | priority(s, bg, t0, t1) | Set render priority |
| Function | Signature | Description |
|---|---|---|
ecolle(e1, e2) | ecolle(e1, e2) | Check collision (bool) |
ecoll(e, tag) | ecoll(e, tag) | Find tag matches (array) |
enthb(e) | enthb(e) | Get hitbox (getter) |
| Function | Signature | Description |
|---|---|---|
btn(num) | btn(num) | Button held? (bool) |
btnp(num) | btnp(num) | Button pressed? (bool) |
btnnp(num) | btnnp(num) | Button released? (bool) |
| Function | Signature | Description |
|---|---|---|
print(text, x, y, fg?, bg?) | print(text, x, y, [fg], [bg]) | Print to overlay |
| Function | Signature | Description |
|---|---|---|
music(f, offset?) | music(f, [offset]) | Play background music |
sound(f, priority) | sound(f, priority) | Play sound effect |
| Function | Signature | Description |
|---|---|---|
poke(addr, value) | poke(addr, value) | Write byte |
poke4(addr, value) | poke4(addr, value) | Write 32-bit word |
peek(addr) | peek(addr) | Read byte |
peek4(addr) | peek4(addr) | Read 32-bit word |
memput(addr, data) | memput(addr, data) | Write to memory |
memget(addr, len?) | memget(addr, [len]) | Read from memory |
| Function | Signature | Description |
|---|---|---|
delta() | delta() | Microseconds since last call |
sleep(frames) | sleep(frames) | Sleep N frames |
startup_time() | startup_time() | Get boot time |
fdog() | fdog() | Feed watchdog timer |
log(msg) | log(msg) | Debug log |
rline() | rline() | Get raster line |
flimit(fps) | flimit(fps) | Set frame rate limit |
next_script(filename) | next_script(filename) | Switch Lua script |
| Function | Signature | Description |
|---|---|---|
connect(timeout) | connect(timeout) | Connect (blocking) |
disconnect() | disconnect() | Disconnect |
send(data) | send(data) | Send message (max 11 bytes) |
recv() | recv() | Receive message |
send_iram(ptr) | send_iram(ptr) | Send from IRAM |
recv_iram(ptr) | recv_iram(ptr) | Receive to IRAM |
| ID | Layer | Size | Description |
|---|---|---|---|
| 0 | Overlay | 32x32 tiles | Front, persistent |
| 1 | Tile Layer 1 | 64x64 tiles | Behind sprites, in front of tile_0 |
| 2 | Tile Layer 0 | 64x64 tiles | Main background |
| 3 | Background | 32x32 tiles | Back layer |
| 4 | Sprites | Dynamic | On-top sprites |
Important: BPCore Engine requires BPCoreEngine.gba base ROM with compiled C++ code and Lua interpreter. This is not a custom ROM you create.
Official Repository: Clone from GitHub
git clone https://github.com/evanbowman/BPCore-Engine.git
cd BPCore-Engine
Required Files: Repository contains:
BPCoreEngine.gba - Engine base ROM (~3.5 MB)build.lua - Build script (Lua 5.3)test/ - Example projectsAlternatives:
your-project/
├── BPCoreEngine.gba # Base ROM (required)
├── build.lua # Build script
├── manifest.lua # Your manifest
├── overlay.bmp # Text/UI tiles
├── tile0.bmp # Main background (64x64 tiles)
├── tile1.bmp # Foreground (64x64 tiles)
├── spritesheet.bmp # Sprites (16x16)
├── music.raw # Music (mono 16kHz PCM)
├── sfx.wav # Sound effects
├── main.lua # Entry point
└── data.txt # Resources
./
├── src/
│ ├── main.lua # Main loop
│ ├── game.lua # Game logic
│ ├── menu.lua # Menu
│ └── level1.csv # Tilemap
├── assets/
│ ├── graphics/
│ │ ├── spritesheet.bmp
│ │ ├── tiles0.bmp
│ │ └── tiles1.bmp
│ ├── audio/
│ │ ├── music.raw
│ │ ├── jump.wav
│ │ └── coin.wav
│ └── tilemaps/
│ └── world.csv
├── build.lua # Build script
├── BPCoreEngine.gba # Engine ROM
└── dist/
└── yourgame.gba # Output
Step 1: Create manifest.lua
local app = {
name = "My Adventure",
gamecode = "ABCD",
makercode = "BC",
tilesets = { "overlay.bmp", "tile0.bmp", "tile1.bmp" },
spritesheets = { "spritesheet.bmp" },
audio = { "music.raw", "jump.wav", "coin.wav" },
scripts = { "main.lua", "game.lua", "menu.lua" },
misc = { "level1.csv" }
}
return app
Step 2: Run build script
lua build.lua manifest.lua BPCoreEngine.gba output.gba
Step 3: Verify
Build checks manifest files exist, formats are valid, scripts readable, output ROM created (~3.5-4 MB).
Step 4: Test with mGBA
mGBA output.gba --log --memview
--log shows engine log() output, --memview opens memory viewer for debugging.
BMP Tilesets: Indexed color (256 colors), tiles are 8x8 pixels. Overlay: 16x16 tiles, Tile_0/1: 32x32 tiles, Sprites: 8x8 sprites.
Audio: Mono 16kHz signed 8-bit PCM. Convert with FFmpeg:
ffmpeg -i input.mp3 -ar 16000 -ac 1 -f s8 output.raw
Tilemap CSV: Comma-separated tile indices, each row is one tile row. Tile indices start at 1 (0 = empty).
Complex topics are split into reference files loaded on demand from ../SKILL.md:
references/save-load.mdreferences/multiplayer.mdreferences/optimization.mdreferences/error-handling.mdThis skill covers BPCore Engine development for GBA:
Refer to official repository for updates.
还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Use when building Python async HTTP services or clients with aiohttp - web server routing, middleware, WebSocket, SSE, streaming, client sessions, pytest-aiohttp testing, or troubleshooting SSL and timeout issues
中文简介正在准备中。当前显示原文说明。
Use when doing structural code search and rewriting - ast-grep linting, refactoring, multi-language patterns
中文简介正在准备中。当前显示原文说明。
Use when running background tasks with Celery - worker and broker configuration (Redis, RabbitMQ), task routing by name vs queue, chains/groups/chords, retry patterns (autoretry_for, retry_backoff), acks_late semantics, failure detection, and monitoring with Flower
中文简介正在准备中。当前显示原文说明。
Use when building Django applications - security hardening, authentication and permissions, ORM optimization, PostgreSQL features, Django 6.0, migrations, testing, and ecosystem libraries
中文简介正在准备中。当前显示原文说明。
Use when customizing Django Admin - save_formset, get_search_results, formsets, queryset optimization, db_index, custom URLs
中文简介正在准备中。当前显示原文说明。
Use when implementing Django authentication - local accounts, OAuth, email verification, MFA, OIDC, django-organizations
中文简介正在准备中。当前显示原文说明。