Close
Close full mode
logots-defold

Quick Start

githubEdit on Github
Last update: 20 days ago by Justin WalshReading time: 2 min

Prerequisites

  1. Install NodeJS (14+ recommended, minimal 12.18).
  2. Install the Defold Editor.
These commands may require root privileges, depending on your operating system and configuration.

Quick Start

  1. Create a new ts-defold project:

    npm init @ts-defold my-indie-hit

    The wizard will guide you through the project configuration

  2. Open the project in your favorite editor

    code ./my-indie-hit
    Visual Studio Code is highly recommended. The template projects come pre-configured with vscode settings and extension recommendations.
  3. Start the development server

    npm run dev

    The development server will start a file watcher and tstl compiler to incrementally compile your changes on save.

  4. Open the project in the Defold Editor (installing defold)

    /Applications/Defold.app/Contents/MacOS/Defold ./app/game.project
    # or
    C:\\Users\\me\\Applications\\Defold\\Defold.exe
    # or
    ~/Defold/Defold ./app/game.project

    The template game project is located at: ./app/game.project.

Project Directory Structure

├─ .eslintrc # 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
├─ 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
Previous
TypeScript ❤️ Defold
Next — 🚀 Getting Started
Project Generator