tsd-template
                                
                                 tsd-template copied to clipboard
                                
                                    tsd-template copied to clipboard
                            
                            
                            
                        Boilerplate TypeScript template with @ts-defold
Defold TypeScript Template (minimal)
A dev environment for Defold that transpiles TypeScript into lua using TypeScriptToLua.
Features
- Full Lua and Defold API type definitions for TypeScript auto-complete and type checking
- Library of types for Defold extensions via npm run resolve
- Eslint config for handling the caveats of TypeScriptToLua and keeping your code correct
- Handles script, gui_script, and module exports using familiar ES6 export syntax
- Full BoilerPlate game project ready to transpile and go
- File watcher via npm run devto transpile on save
Note that you will need to have Node.js installed.
Quick Start
- Use npm run devto start a watcher that compiles and emits lua and script when you save
- Use npm run buildto just compile your ts, sans watcher
Installation
- Fork this template or use degit to download the template locally
npx degit ts-defold/tsd-template my-game
# or
git clone https://github.com/ts-defold/tsd-template.git my-game
- Initialize
cd my-game
npm install
- Generate
npm run build # Transpile the TypeScript files to lua
# or
npm run dev # Watch for changes and regenerate files on save
- Code
code .
- Open app/game.projectin Defold
- Start making games with TypesScript!
TypeScript :heart: Defold