Cotton is a framework for Pulp-like experiences in Lua. It will allow you to use most of the features Pulp has to offer, but instead of being limited by Pulp, this framework is extendible, has LDtk build-in for easy level editing, and more!
Some of the key features you find in Cotton.
- A library containing most features that Pulp has to offer (CottonScript)
- Preconfigured level editor (LDtk)
- Runs at 30 frames per second.
- Integrated scene management for easy switching out of the game into a cutscene and back.
- Toggleable FPS counter.
- A versionable project structure for easy git use.
- Custom folder structuring allows for better organizing your project.
- Toggleable player types (grid, topdown, platformer)
- Toggleable smooth movement.
- Preconfigured compile & play buttons in VS code.
- Resizeable levels.
- Easy level caching for fast level loading.
- Automatic code formatting on save to keep your code clean and organised.
- Multi-tile player support.
- Panels library support.
Make sure you have the following applications installed:
- Download and install the requirements above.
- Download the latest version of Cotton
zip
file. - Extract it in the projects folder your choosing.
- Open the folder in VS Code,
- When it asks you which
workspace
you want to open? Choosesimple.code-workspace
. - When it asks "do you want to install recommended plugins?" You say yes and do so. ( This will give acces to to features like compile tasks, automatic Lua formatting, etc.)
- You are now ready to work in the project!
If you are on Windows, some environment vars need to be set before you can compile your games. Follow the Environment Variables Guide to set the environment variables for Windows.
Make sure VS Code
with a Cotton
workspace is open. (simple
or advanced
are both fine)
Docs can be found in Docs
. Press the preview button in the topRight corner of your scripting window to have a nicer reading view.
Make sure VS Code
with a Cotton
workspace is open. (simple
or advanced
are both fine)
- Click
Task Runner
from the sidebar. - Click
Playdate: Level Editor
- Click the
Load
button - Open the
<your-project-folder>/Source/levels/world.ldtk
Make sure VS Code
with a Cotton
workspace is open. (simple
or advanced
are both fine)
- Click
Task Runner
from the sidebar. - Click
Playdate: Build and Run
Want to use the native tasks function of VS code? We have a tutorial for that too! Just check here: without task runner extension
Since Cotton has a pretty extensive feature list. We created a official wiki for all documentation. You can find it here: Wiki.
The FAQ can be found here: FAQ.
CottonScript is a scripting library that contains most Pulp features. Documentation for CottonScript can be found here: CottonScript.
- Nic Magnier for offering the LDtk library
- Guv_Bubbs for helping out with the docs