playdate-dev

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Playdate Dev

Playdate 开发

Overview

概述

Build and troubleshoot Playdate games in Lua with Playdate-specific constraints, input, and SDK workflows.
使用Lua开发并排查Playdate游戏问题,适配Playdate专属限制、输入方式与SDK工作流。

Quick Start Workflow

快速入门工作流

  1. Clarify the request scope (gameplay goal, target device vs simulator, SDK version, release vs prototype).
  2. Choose inputs and accessibility (buttons, crank, accelerometer; provide alternatives; respect reduce-flashing setting).
  3. Choose rendering approach (sprites vs immediate draw, image sizes, refresh rate, 1x vs 2x scale).
  4. Implement the core loop (define
    playdate.update()
    , update game state, call
    playdate.graphics.sprite.update()
    and
    playdate.timer.updateTimers()
    when used).
  5. Add metadata and launcher assets (
    pdxinfo
    , buildNumber, launcher card and icon sizes).
  6. Test in the Simulator and on hardware (screen legibility, crank feel, audio balance, performance).
  1. 明确需求范围(玩法目标、目标设备/模拟器、SDK版本、正式发布/原型版本)。
  2. 选择输入方式与无障碍方案(按键、曲柄、加速度计;提供替代操作方案;遵循减少闪烁设置)。
  3. 选择渲染方案(精灵绘制/即时绘制、图片尺寸、刷新率、1x/2x缩放)。
  4. 实现核心循环(定义
    playdate.update()
    ,更新游戏状态,使用相关能力时调用
    playdate.graphics.sprite.update()
    playdate.timer.updateTimers()
    )。
  5. 添加元数据与启动器资源(
    pdxinfo
    、构建号、启动卡片与图标尺寸)。
  6. 在模拟器和真机上测试(屏幕可读性、曲柄手感、音频平衡、性能)。

Starter Project

初始项目

  • Copy
    assets/lua-starter
    into a new project folder.
  • Keep
    Source/main.lua
    and
    Source/pdxinfo
    in the source root.
  • Replace placeholder values in
    pdxinfo
    and extend the update loop.
  • assets/lua-starter
    复制到新的项目文件夹中。
  • 保留源码根目录下的
    Source/main.lua
    Source/pdxinfo
    文件。
  • 替换
    pdxinfo
    中的占位符值,扩展更新循环逻辑。

Implementation Notes

实现注意事项

  • Use
    references/inside-playdate-lua.md
    for Lua API names, file layout, and workflow details.
  • Use
    references/designing-for-playdate.md
    for screen, text, input, audio, UI, and launcher guidance.
  • Use Context7
    /websites/sdk_play_date
    to spot-check API changes, then confirm Lua behavior in the latest SDK docs.
  • 查阅
    references/inside-playdate-lua.md
    获取Lua API名称、文件结构与工作流详情。
  • 查阅
    references/designing-for-playdate.md
    获取屏幕、文本、输入、音频、UI与启动器相关规范。
  • 使用Context7
    /websites/sdk_play_date
    核查API变更,再对照最新SDK文档确认Lua行为。

Resources

资源

  • references/designing-for-playdate.md
  • references/inside-playdate-lua.md
  • assets/lua-starter/
  • references/designing-for-playdate.md
  • references/inside-playdate-lua.md
  • assets/lua-starter/