Commit b478cea6 authored by Delisa Mason's avatar Delisa Mason

docs: Add a readme

parent de724625
top-down love template
A 2D game template for love!
## Usage
1. Copy this directory to your new game location
cp -r love-template/ locklight-chronicles/
2. Edit [conf.lua](conf.lua), adding your game name and tweaking
[config options](
3. Edit the map, level state, and systems to add game mechanics
4. Polish with assets and juiciness
5. Package it!
6. [Shout about it!](
## States
Game behavior is divided by
[`hump.gamestate`]( tables.
On load, the [`title`](game/states/title.lua) state pushed onto the stack, which
in turn lists for the start input and pushes the
[`level`](game/states/level.lua) state. The core gameplay occurs in the level
## Systems
Level logic is divided into systems which manipulate game data based on input
and time elapsed. Systems are controlled by a manager object which coordinates
local systems = require ''
A system can implement and receive event callbacks for the following events:
* `update` - manage game state frame-to-frame (and optionally perform
setup/teardown in `preUpdate` and `postUpdate`)
* `draw` - render content onscreen
* `keyreleased` - Handle a key release event
Once implemented, it can be added to the manager:
local system = {
update = function(state, dt)
-- do stuff!
draw = function(state, dt)
-- draw stuff!
The `state` argument is the data the system should manipulate.
System callbacks are run in the order they are added.
The following systems are included:
* [Render Map](game/systems/render_map.lua) - Renders a
[Tiled]( map onscreen, following the player with a
* [Movement](game/systems/movement.lua) - Manages collisions between objects and
moves objects according to their velocity
* [Player Input](game/systems/player_input.lua) - Reads input devices updating
the player velocity/direction and action button state
* [Trigger](game/systems/trigger.lua) - Responds to active action button state,
using collision data to determine if an actionable object is in range,
activating object callbacks if so.
## Libraries
The following libraries are included:
* [`anim8`]( - frame-based animation
* [`bump`]( - collision detection
* [`camera`/STALKER-X]( - a camera module
with lerp and lead and simple screen effects
* [`hump.gamestate`]( - game data and behavior encapsulation
* [`hump.signal`]( - Observers
* [`hump.timer`]( - function
execution scheduling and tweening
* [`hump.vector`]( - 2D vector
* [`sti`]( - Tiled map
loader and renderer
## Assets
In addition to the [fantastic default art](assets/images/player.png), this
template includes the
[Shattered]( font by eeve
## Tools
| Make target | |
|`build`/`run` | Run the game |
|`test` | Lint and run tests, if any |
### Creating files
| Make target | |
|`add-hooks` | Creates a new trigger script from [a template](.templates/hooks.lua) |
|`add-map` | Creates a new map from [a template](.templates/map.tmx) |
|`add-state` | Creates a new gamestate from [a template](.templates/state.lua) |
|`add-system` | Creates a new system from [a template](.templates/system.lua) |
### Tiled integration
The Makefile includes helpers for scripting and running the game from Tiled.
Additional documentation is available in the Makefile itself.
| Make target | |
|`tiled-run` | Runs the game after exporting the map currently open |
|`tiled-edit-hooks` | Creates and/or opens the trigger script for the object selected in the map |
## Resources
### Planning
* Pencil and cheap paper for planning, doodling, storyboarding
* [One game a month!](
* []( for [asset packs](,
[game jams](, and [tools](
### Coding
* [love2d wiki](
### Assets
* [aseprite]( for pixel art editing
* [bfxr]( for sound effects
* [milkytracker]( for chiptunes
* [musescore]( for sheet music editing
* [pixel art palettes and online editor](
* [Adam Saltsman's public domain tilesets](
* [Pedro Medeiros' pixel art tutorials](, [Mort
Mort's pixel art tutorials](
* [Free sound effects]( and
### Packaging
* [Love Game Distribution guide](
* [presskit.html](
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment