Quick Start
Last update: a minute ago by Nathan BoltonReading time: 2 min
Prerequisites
- Install NodeJS (LTS recommended).
- Install the Defold Editor.
These commands may require root privileges, depending on your operating system and configuration.
Quick Start
Create a new ts-defold project:
npm init @ts-defold my-indie-hitThe wizard will guide you through the project configuration
Open the project in your favorite editor
code ./my-indie-hitVisual Studio Code is highly recommended. The template projects come pre-configured with vscode settings and extension recommendations.Start the development server
npm run devThe development server will start a file watcher and TSTL compiler to incrementally compile your changes on save.
Open the project in the Defold Editor (installing defold)
/Applications/Defold.app/Contents/MacOS/Defold ./app/game.project# orC:\\Users\\me\\Applications\\Defold\\Defold.exe# or~/Defold/Defold ./app/game.projectThe template game project is located at:
./app/game.project
.
Project Directory Structure
├─ .prettierrc.json # Configuration for prettier code formatting├─ eslint.config.mjs # Eslint configured to handle the caveats of TSTL & ts-defold├─ package.json # NPM package dependencies and metadata├─ tsconfig.json # TypeScript compiler configuration for TSTL & ts-defold│├─ .github/ # Github workflows and automation [optional]├─ .vscode/ # Settings, extensions, and tasks for Visual Studio Code├─ @types/ # Type definitions for your project and native extensions│├─ app/ # The Defold game project│ ├─ lualib_bundle.lua # TypeScript support library│ ├─ modules/ # Transpiled shared lua modules│ ├─ scripts/ # Transpiled Defold game scripts (lua)│├─ src/ # TypeScript src files [edit these]│ ├─ modules/ # Shared modules│ ├─ scripts/ # Defold game scripts