This project demonstrates a complete Lua game development environment with TypeScript/JavaScript integration.
All components successfully set up:
- LOVE2D game (Space Shooter)
- TypeScript integration examples
- JavaScript integration examples
- Cross-platform installation scripts
- Cross-platform start scripts
- Type declarations for untyped libraries
- No linting errors
- No border radius in graphics
Run the installation script for your platform:
macOS/Linux:
./install.shWindows:
install.batThis will:
- Guide you through LOVE2D installation
- Guide you through Node.js installation
- Automatically install npm dependencies
- Verify all installations
Use the start script for an interactive menu:
macOS/Linux:
./start.shWindows:
start.batMenu options:
- Run LOVE2D game only
- Run JavaScript backend only
- Run TypeScript backend only
- Run game + JavaScript backend
- Run game + TypeScript backend
- Run all services together
Run the game:
love .Run JavaScript examples:
cd integration
npm start
# or
node lua-runner.jsRun TypeScript examples:
cd integration
npm run start:ts
# or
npx ts-node lua-bridge.tsBuild TypeScript to Lua:
cd integration
npm run build:lualua-example/
├── install.sh # Installation script (macOS/Linux)
├── install.bat # Installation script (Windows)
├── start.sh # Start script with menu (macOS/Linux)
├── start.bat # Start script with menu (Windows)
├── main.lua # Main game code
├── conf.lua # LOVE2D configuration
├── README.md # Main documentation
├── START_SCRIPTS.md # Start script documentation
├── assets/ # Game assets folder
├── logs/ # Backend service logs
└── integration/ # TypeScript/JavaScript integration
├── lua-bridge.ts # TypeScript-Lua bridge
├── lua-runner.js # JavaScript examples
├── tstl-game.ts # TypeScript to Lua example
├── package.json # npm configuration
├── tsconfig.json # TypeScript config
├── tsconfig.tstl.json # TypeScriptToLua config
└── types/ # Type declarations
├── fengari.d.ts
├── fengari-interop.d.ts
└── README.md
- LOVE2D 11.4: Lua game framework
- Lua: Programming language
- Procedural graphics (no sprites)
- Particle systems
- Game state management
- Node.js: JavaScript runtime
- TypeScript: Type-safe JavaScript
- Fengari: Lua VM in pure JavaScript
- Wasmoon: Lua 5.4 via WebAssembly
- TypeScriptToLua: Compile TypeScript to Lua
- Space shooter gameplay
- Procedural graphics with glow effects
- Particle explosion effects
- Parallax scrolling stars
- Multiple enemy types
- Score tracking
- Lives system
- Execute Lua code from JavaScript/TypeScript
- Call Lua functions from JS/TS
- Type-safe Lua bindings
- Entity system examples
- Game engine bridge patterns
- Multiple Lua runtime options
| Key | Action |
|---|---|
| W / Up Arrow | Move up |
| S / Down Arrow | Move down |
| A / Left Arrow | Move left |
| D / Right Arrow | Move right |
| Space | Shoot / Start game |
- No emojis in documentation
- No border radius in graphics (sharp edges)
- Cross-platform compatible
- Type-safe TypeScript integration
- Zero linting errors
- Comprehensive error handling
| Script | Platform | Purpose |
|---|---|---|
| install.sh | macOS/Linux | Interactive installation |
| install.bat | Windows | Interactive installation |
| start.sh | macOS/Linux | Launch services menu |
| start.bat | Windows | Launch services menu |
From the integration/ directory:
| Command | Description |
|---|---|
| npm start | Run JavaScript examples |
| npm run start:js | Run JavaScript examples |
| npm run start:ts | Run TypeScript examples |
| npm run build | Compile TypeScript |
| npm run build:lua | Compile TypeScript to Lua |
When running multiple services, logs are saved to:
logs/js-backend.log- JavaScript integration outputlogs/ts-backend.log- TypeScript integration output
- LOVE2D: https://love2d.org/
- Lua: https://www.lua.org/
- TypeScriptToLua: https://typescripttolua.github.io/
- Fengari: https://fengari.io/
- Wasmoon: https://github.com/ceifa/wasmoon
MIT License - Free to use for any purpose.