An open API service indexing awesome lists of open source software.

https://github.com/benc-uk/lua-love-template

Love2D Template for VSCode
https://github.com/benc-uk/lua-love-template

game-development love2d lua template-project

Last synced: 2 months ago
JSON representation

Love2D Template for VSCode

Awesome Lists containing this project

README

          

# Love2D Template for VSCode

This repository is a template for creating Love2D projects with Visual Studio Code. It includes a pre-configured development environment, debugging setup, and build tools to streamline your workflow.

## Features

- **Pre-configured Visual Studio Code settings**:

- Lua language server support via [sumneko.lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua).
- Debugging support with [local-lua-debugger-vscode](https://marketplace.visualstudio.com/items?itemName=tomblind.local-lua-debugger-vscode).
- Linting with [luacheck](https://marketplace.visualstudio.com/items?itemName=rog2.luacheck).

- **Debugging support**:

- Automatically enables the 'Lua Local' debugger when running in debug mode.

- **Build tools**:

- A PowerShell script to package your Love2D project into a `.love` file and a Windows executable.

- **Example project**:

- A simple "Hello World" Love2D project

- **Included libraries**:

Libraries included in the `src/lib/` directory, under the terms of their respective MIT licenses:

- [rxi/lume](https://github.com/rxi/lume) A host of useful game dev functions
- [rxi/json.lua](https://github.com/rxi/json.lua) JSON parsing
- [kikito/inspect.lua](https://github.com/kikito/inspect.lua) This library transforms any Lua value into a human-readable representation

## Getting Started

### Prerequisites

1. Install [Love2D](https://love2d.org/).
1. Make sure that love.exe is in your Windows PATH.
2. Install Visual Studio Code and the recommended extensions:

- [sumneko.lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua)
- [local-lua-debugger-vscode](https://marketplace.visualstudio.com/items?itemName=tomblind.local-lua-debugger-vscode)
- [luacheck](https://marketplace.visualstudio.com/items?itemName=rog2.luacheck)

### Running the Project

1. Open this repository in Visual Studio Code.
2. Press `F5` to start debugging or run the project in release mode using the configurations in `.vscode/launch.json`.

### Building for Windows

This will build a standalone exe from the code in `src/` the resulting executable will be `dist/out.exe`

1. Open a PowerShell terminal.
2. Run the `tools/build-win.ps1` script:
```ps1
.\tools\build-win.ps1 .\src .\dist
```

Or from VS Code pick 'Terminal > Run Build Task'