Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/james2doyle/love2d-template
A LÖVE (Love2d) template that includes what you may need to develop a game with modern niceties
https://github.com/james2doyle/love2d-template
love2d lua
Last synced: 13 days ago
JSON representation
A LÖVE (Love2d) template that includes what you may need to develop a game with modern niceties
- Host: GitHub
- URL: https://github.com/james2doyle/love2d-template
- Owner: james2doyle
- License: mit
- Created: 2024-11-21T07:17:38.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-21T07:19:28.000Z (3 months ago)
- Last Synced: 2024-11-21T08:22:37.552Z (3 months ago)
- Topics: love2d, lua
- Language: Lua
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Love2D Template
===============> A LÖVE (Love2d) template that includes everything you need to develop a game with modern niceties
### Why?
Mostly just exploring Love2d and some modules. Also trying to wrap my head around how I should structure a game and all it's parts.
### Install
```sh
git clone https://github.com/james2doyle/love2d-template
cd love2d-template
love .
```### Running
The game starts with a splash page, then goes to the main menu. You can click some of the menu items to go to those other menus. Pressing any button in the credits goes back to the main menu.
Pressing `\`` at any time will toggle the debug menu.
### Modules
* [Badr](https://github.com/Nabeel20/Badr) - Simple and easy user interfaces with composable components
* [Roomy](https://github.com/tesselode/roomy) - Organize your game into "screens" (title/start screen, levels, pause screen)
* [Flux (fork)](https://github.com/Sheepolution/flux) - Fast, lightweight tweening library
* [Step](https://github.com/Sheepolution/step) - Timer module for interval actions or delayed actions
* [Lurker (fork)](https://github.com/jeduden/lurker) - Auto-swaps changed files in a running
* [Lume (fork)](https://github.com/NQMVD/lume) - Helpful functions
* [Luacolors](https://github.com/icrawler/luacolors) - Collection of functions for common colors and conversions## Snippets
#### A new "scene"
```lua
local _sceneName = {}-- `previous` - the previously active scene, or `false` if there was no previously active scene
-- `...` - additional arguments passed to `manager.enter` or `manager.push`
function _sceneName:enter(previous, ...)
-- set up the level
endfunction _sceneName:update(dt)
-- update entities
endfunction _sceneName:keypressed(key)
-- someone pressed a key
endfunction _sceneName:mousepressed(x, y, button, istouch, presses)
-- someone clicked the mouse
end-- `next` - the scene that will be active next
-- `...` - additional arguments passed to `manager.enter` or `manager.pop`
function _sceneName:leave(next, ...)
-- destroy entities and cleanup resources
end-- `next` - the scene that was pushed on top of this scene
-- `...` - additional arguments passed to `manager.push`
function _sceneName:pause(next, ...)
-- destroy entities and cleanup resources
end-- `previous` - the scene that was popped
-- `...` - additional arguments passed to `manager.pop`
function _sceneName:resume(previous, ...)
-- Called when a scene is popped and this scene becomes active again.
endfunction _sceneName:draw()
-- draw the level
endreturn _sceneName
```