https://github.com/cadin/panels-cutscene-example
Example showing how to integrate Panels comics into a Playdate game.
https://github.com/cadin/panels-cutscene-example
playdate
Last synced: 5 months ago
JSON representation
Example showing how to integrate Panels comics into a Playdate game.
- Host: GitHub
- URL: https://github.com/cadin/panels-cutscene-example
- Owner: cadin
- Created: 2022-09-04T00:13:53.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-26T18:19:47.000Z (8 months ago)
- Last Synced: 2025-07-27T13:31:24.317Z (6 months ago)
- Topics: playdate
- Language: Lua
- Homepage:
- Size: 363 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Panels Cutscene Example
An example project demonstrating how to use [Panels](https://github.com/cadin/panels) comics as cutscenes within your game.
## Setup
This project includes the Panels framework as a git submodule. Be sure to properly [initialize the submodule](https://www.w3docs.com/snippets/git/how-to-clone-including-submodules.html) when cloning the repo.
If you're not using git, you can download this code as a ZIP file. In that case you'll also need to download the code from the [Panels repo](https://github.com/cadin/panels) and place it in the `source/libraries/panels/` folder of this template.
## Usage
- Import Panels
- When you want to start a cutscene, call `Panels.startCutscene(data, callback)` where `data` is the [`comicData`](https://cadin.github.io/panels/docs/comic-data/) for the entire cutscene and `callback` is a function in your game that will be called when the cutscene finishes.
- While the cutscene is running (until your callback is called) call `Panels.update()` from your main [Playdate update loop](https://sdk.play.date/1.12.3/Inside%20Playdate.html#c-update).
- When the cutscene completes, simply stop calling `Panels.update()`.
## Example Game
- `Dpad` to move the box on screen
- `A` button to trigger cutscene and move to the next level of the game