2022-04-27 18:32:52 +00:00
|
|
|
# Love Loader
|
|
|
|
|
|
|
|
Custom menu for selecting game from multiple for Love2D.
|
|
|
|
|
|
|
|
# How it works?
|
|
|
|
|
|
|
|
If simple: just place games in `games` folder with structure like `games/yourgame/main.lua`
|
|
|
|
|
|
|
|
If technically: creates local variables functions and variables.
|
|
|
|
Creates the loop until game wasn't selected with manual event handling and redrawing.
|
|
|
|
|
|
|
|
# Things left or API
|
|
|
|
|
|
|
|
We are not keep environment super clear (except local variables ;))
|
|
|
|
so there are some variables can be used in game:
|
|
|
|
|
|
|
|
`W` and `H` variables: width and height of the screen, controlled by love.resize function.
|
2022-04-27 18:33:49 +00:00
|
|
|
|
2022-04-27 18:32:52 +00:00
|
|
|
`love.resize` and optional `resize` payload: functions called when screen size when changed and at boot.
|
2022-04-27 18:33:49 +00:00
|
|
|
|
2022-04-28 18:35:21 +00:00
|
|
|
`love.event.quit`: function to quit to menu screen
|
|
|
|
|
|
|
|
`COLDIV`: color divider (1 or 255) to setColor function
|
|
|
|
|
|
|
|
`llUsed`: is Love Loader used
|
|
|
|
|
|
|
|
`llHome`: function to quit to menu screen
|
|
|
|
|
|
|
|
They also can be used without Love Loader if load `ll-min.lua`
|
2022-04-27 18:32:52 +00:00
|
|
|
|
|
|
|
# Fill game information
|
|
|
|
|
|
|
|
To fill game information in game folder need to create `info.ll` file.
|
|
|
|
|
|
|
|
Syntax is `k = v` with `# comments`
|
|
|
|
|
|
|
|
```
|
|
|
|
# are there needed any comments?
|
|
|
|
name = New awesome game using Love Loader
|
|
|
|
desc = Some descripion about the game.
|
|
|
|
# main = optional main file instead of `main.lua`
|
2022-04-28 18:35:21 +00:00
|
|
|
pic = screen.png
|
|
|
|
pics = [ screen.png; screen2.png ] # wow array
|
2022-04-27 18:32:52 +00:00
|
|
|
```
|