Skip to content

Playbit is a framework for creating cross-platform Playdate games from a single Lua codebase.

License

Notifications You must be signed in to change notification settings

GamesRightMeow/playbit

Repository files navigation

Playbit

Playbit template running

Playbit is a framework for creating cross-platform Playdate games from a single Lua codebase. To accomplish this, it has two key components:

⚠ IMPORTANT: This project is in active development and has not reached a stable 1.0 release yet. Use in a production environment at your own risk.

Why should you use Playbit?

If you're looking for a framework for creating cross-platform Playdate games from a single Lua codebase, then that's Playbit's primary goal!

However Playbit's features also can help improve your workflow when working on Playdate-only games too. For example:

  • Builds scripts allow you to create automated build configurations. Do you have a separate demo build and paid build? Create a separate build script for each!
  • Process assets at build-time with file processors to generate more performant versions e.g. work directly with Aseprite (.aseprite) to retain layers, tags, and other features and then auto-generate PNGs at build-time.
  • Compile out blocks of code with preprocessor flags that aren't relevant for builds e.g. add development tools to test builds without adding bloat to your final production builds.
  • Write more performant and maintainable code e.g. instead of calling math.abs(num) in a performance critical area (function calls can add up!) you can inline the method with a macro.

Additionally, if you're not creating a cross-platform game, all Playdate SDK functions are available to you since Playbit doesn't need to emulate them for Love2D.

Current features

  • Customizable preprocessor flags
  • Customizable build scripts
  • Process assets at build-time with file processors
  • Macro support (via LuaPreprocess's macros)
    • Compile asserts out for release builds (via LuaPreprocess's ASSERT() macro)
  • Automatic generation of pdxinfo file with auto-incrementing build number
  • A template repo, featuring:
    • A working barebones example project
    • Example build scripts for common configurations
    • Pre-configured build tasks for VS Code.

Additionally, a core aspect of Playbit is the the implementation of Playdate API in Love2D. It's still a work-in-progress; more functions will be added over time. The following are currently available, with noted caveats:

  • playdate.graphics
    • Basic drawing functions like fillRect(), line(), circ(), etc
    • Push/pop contexts
    • Draw modes - only copy, fillWhite, fillBlack
  • playdate.image
  • playdate.imagetable
  • playdate.easingFunctions
  • playdate.font
    • Has limitations, see issues #2 and #20.
  • playdate.sound
    • Only sampleplayer and fileplayer
  • Some functions under the general playdate namespace
    • Input (button presses, crank, etc)
      • Supports remapping
      • Supports keyboards and controllers
    • getCurrentTimeMilliseconds()

This list is not comprehensive. For complete details on currently implemented SDK functions, review the source code and review open issues.

Documentation

Documentation can be found in the docs folder. If you're new, it's recommended that you first read Getting Started.

If you want to jump straight in, create a new repository using the Playbit template.

About

Playbit is a framework for creating cross-platform Playdate games from a single Lua codebase.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Languages