PICO-8

八位机风格的游戏开发工具,使用Lua作为脚本语言。

可用于快速实现某些简单的、轻巧的游戏原型。

语法说明

PICO-8 使用 Lua 5.2 和 z8lua (Sam Hocevar) 来运行Lua,这包含了仅在PICO-8生效的某些特定简写语法。

PICO-8 的特殊语法特性:

  • short if syntax (on one line)
  • short print syntax (?”hello”)
  • compound assignment operators: += /= etc.
  • C style not equal operator: !=
  • C++ style comments with //
  • fixed-point arithmetic with overflows, infinity etc.
  • the PICO-8 math library (shr, atan2, flr etc.)
  • binary literals: 0b1001001.10010
  • works in Windows, Linux, OS X, and many embedded systems

PICO-8 特性

Display: 128x128, fixed 16 colour palette
Input:   6-button controllers
Carts:   32k data encoded as png files
Sound:   4 channel, 64 definable chip blerps
Code:    P8 Lua (max 8192 tokens of code)
CPU:     4M vm insts/sec
Sprites: Single bank of 128 8x8 sprites (+128 shared)
Map:     128 x 32 Tilemap (+ 128 x 32 shared)