Quick Start
Creating a New Project (CLI)
Section titled “Creating a New Project (CLI)”The easiest way to get started with Dill Pixel is to use the CLI to create a new project. Run the following command in your terminal:
npx dill-pixel create my-application
This will create a new directory called my-application
with all the necessary files and dependencies pre-configured.
Using PNPM (Recommended)
Section titled “Using PNPM (Recommended)”npx dill-pixel create my-application --use-pnpm
Manual Installation
Section titled “Manual Installation”If you prefer to set up your project manually, you can install the framework directly:
npm i dill-pixel
yarn add dill-pixel
pnpm install dill-pixel
“Hello World” Example
Section titled ““Hello World” Example”Project Structure
Section titled “Project Structure”When you create a new project using the CLI, it will generate the following file structure:
- package.json
- tsconfig.json
- vite.config.mjs
- index.html
- .assetpack.mjs
- .eslintrc.json
- .prettierrc.json
- .nvmrc
Directorysrc
- index.ts
- index.css
- bootstrap.ts
- MyApplication.ts
- dill-pixel.config.ts
- Splash.ts
Directoryscenes
- BaseScene.ts
- StartScene.ts
Directoryutils
- Constants.ts
Directoryassets
Directoryaudio{m}
Directorymusic
- Game_Over.ogg
Directorysfx
- click.ogg
- hover.ogg
Directoryrequired{m}
Directoryui{tps}
Directorybtn
- blue.png
- green.png
Directoryjoystick
- base.png
- handle.png
Directoryspine{m}
- spineboy-pro.png
- spineboy-pro.atlas
- spineboy-pro.skel
Key Files and Directories
Section titled “Key Files and Directories”src/MyApplication.ts
: Main application class extending from Dill Pixel’s Applicationsrc/bootstrap.ts
: Initializes the game and handles core setupsrc/dill-pixel.config.ts
: Core game configuration including actions, controls, and data managementsrc/Splash.ts
: Default loading screen implementationsrc/scenes/
: Contains all game scenesBaseScene.ts
: Base scene class with shared functionalityStartScene.ts
: Initial game scene with “Hello Dill Pixel” example
src/utils/Constants.ts
: Shared constants like fonts and colors.assetpack.mjs
: Asset processing configuration.eslintrc.json
: Code linting rules.prettierrc.json
: Code formatting rules
Start the Dev Server
Section titled “Start the Dev Server”npm run dev
yarn dev
pnpm dev
Build for Production
Section titled “Build for Production”npm run build
yarn build
pnpm run build