Skip to content

matreshka15/Playdate-C-Template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Playdate C Game Template

English ยท ไธญๆ–‡ ยท โšก 3-Minute Quickstart

A zero-config, pure-C starter for Playdate games on Windows. No CMake. No Make. Just setup.ps1 โ†’ build.ps1 -Run.

License: MIT Playdate SDK Windows


๐Ÿš€ Get Running in 3 Commands

Open PowerShell in this folder:

# 1. Install & verify everything (first time only)
.\setup.ps1

# 2. Build + launch in the simulator
.\build.ps1 -Run

# 3. In VS Code โ€” press F5.   That's the whole workflow.

The first command does everything: finds your SDK + Visual Studio, sets PLAYDATE_SDK_PATH, writes setup-config.json, and offers to build the demo for you on the spot.

Brand-new to this? โ†’ QUICKSTART.md walks through your first code change in 3 minutes.


๐Ÿ“‹ Requirements

Tool Version Why you need it
Windows 10/11 64-bit The build targets MSVC x64
Playdate SDK 2.0+ Provides pd_api.h, pdc.exe, the simulator
Visual Studio 2017 / 2019 / 2022 Contains the C compiler (cl.exe)
โ†’ VS C++ workload required Tick "Desktop development with C++" during install
PowerShell 5.0+ (built-in) Runs the build scripts
VS Code optional One-click F5 build + debug

Missing something? .\setup.ps1 will tell you exactly what and link you to the download page. It is safe to re-run at any time.


๐Ÿ“ What's in the box

๐Ÿ“ฆ Playdate-C-Template/
โ”‚
โ”œโ”€โ”€ ๐Ÿ”ง setup.ps1            โ† run first (wizard)
โ”œโ”€โ”€ ๐Ÿ”จ build.ps1            โ† build / run / clean
โ”œโ”€โ”€ ๐Ÿงช test.ps1             โ† smoke-test the template itself
โ”‚
โ”œโ”€โ”€ ๐Ÿ’ป src/
โ”‚   โ””โ”€โ”€ main.c              โ† your game code lives here
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ฆ setup-config.json    โ† project name / author / paths (auto-written)
โ”œโ”€โ”€ ๐Ÿ“„ CMakeLists.txt       โ† optional CMake path (not required)
โ”‚
โ”œโ”€โ”€ ๐ŸŽจ .vscode/             โ† F5 = build+run+debug, tasks pre-wired
โ”‚
โ””โ”€โ”€ ๐Ÿ“– docs/
    โ”œโ”€โ”€ GETTING_STARTED.md  โ† API tutorial
    โ”œโ”€โ”€ DEVELOPER_GUIDE.md  โ† build internals
    โ”œโ”€โ”€ PUBLISHING_GUIDE.md โ† ship to the Playdate catalog
    โ””โ”€โ”€ CONTRIBUTING.md

Add your own .c / .h files to src/ โ€” the build auto-discovers them. No build-script edits required.


๐Ÿ’ป Daily commands

Command Does
.\build.ps1 -Run build + launch simulator (โญ most-used)
.\build.ps1 build only
.\build.ps1 -Clean wipe build/ and *.pdx
.\build.ps1 -Config Release optimized, no debug symbols
.\build.ps1 -Target Device cross-compile for real hardware (needs ARM toolchain + CMake)
.\setup.ps1 -Mode check diagnose a broken environment

In VS Code:

Key Action
F5 Build + launch + attach debugger
Ctrl+Shift+B Build only
F9 Toggle breakpoint
F10 / F11 Step over / into

๐Ÿ”ง Rename / customize the project

Edit setup-config.json:

{
  "projectName": "MyAwesomeGame",
  "author":      "Your Name",
  "description": "The best Playdate game ever!",
  "bundleID":    "com.yourname.myawesomegame"
}

Then rebuild: .\build.ps1. The script regenerates pdxinfo from these fields and .vscode/settings.json is kept in sync so F5 still works.


โš ๏ธ Troubleshooting

Symptom Fix
Scripts cannot be loaded Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
Cannot find SDK Re-run .\setup.ps1, or set $env:PLAYDATE_SDK_PATH manually
cl is not recognized Install VS 2022 + "Desktop development with C++" workload
Cannot open include file 'pd_api.h' PLAYDATE_SDK_PATH is stale โ†’ re-run .\setup.ps1
F5 error: MyPlaydateGame.pdx not found You renamed the project but didn't rebuild โ†’ run .\build.ps1
Anything else Run .\setup.ps1 -Mode check โ€” it diagnoses the whole toolchain

Detailed logs land in logs/.


๐Ÿ“š Docs

Doc Read when
QUICKSTART.md First 5 minutes
docs/GETTING_STARTED.md Learning the Playdate C API
docs/DEVELOPER_GUIDE.md Build internals, advanced workflows
docs/PUBLISHING_GUIDE.md Before you ship
docs/CONTRIBUTING.md Sending PRs / issues

External: Official SDK docs ยท Dev forum ยท play.date/dev


๐Ÿ“œ License

MIT โ€” make games freely. ๐ŸŽฎ

Ready? Open PowerShell and run .\setup.ps1.

About

๐ŸŽฎ Beginner-friendly Playdate C game template with one-command setup!

Topics

Resources

Contributing

Stars

Watchers

Forks

Contributors

Languages