Skip to content

Quick Start

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:

Terminal window
npx dill-pixel create my-application

This will create a new directory called my-application with all the necessary files and dependencies pre-configured.

Terminal window
npx dill-pixel create my-application --use-pnpm

Manual Installation

If you prefer to set up your project manually, you can install the framework directly:

Terminal window
npm i dill-pixel

“Hello World” Example

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

  • src/MyApplication.ts: Main application class extending from Dill Pixel’s Application
  • src/bootstrap.ts: Initializes the game and handles core setup
  • src/dill-pixel.config.ts: Core game configuration including actions, controls, and data management
  • src/Splash.ts: Default loading screen implementation
  • src/scenes/: Contains all game scenes
    • BaseScene.ts: Base scene class with shared functionality
    • StartScene.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

Terminal window
npm run dev

Build for Production

Terminal window
npm run build