Skip to content

rhysuki/go.love

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple project skeleton for LÖVE games that takes inspiration from Godot. It's geared toward low-spec 2D pixel-art games, and includes libraries and assets to get you up and running as soon as you fork the repo.

Usage

To see the demo, run this repo as a LÖVE project. You can safely delete the entire demo folder and the line Demo:run(root, Demo.basic) in main.lua.

This project is thoroughly annotated and documented with Lua Language Server annotations, which help tremendously for diagnostics, autocompletion, and opt-in type safety. If your environment doesn't support LLS, you can safely remove comments like ---@class, ---@field, etc, to make the code less noisy.

/src/

Important

For further info and examples, read the documentation on each module's source files.

Node is the building block for every ingame object. Nodes can have other Nodes as children, which are updated and drawn automatically, forming a tree structure.

Signal implements the observer pattern, making communication between Nodes easy and loosely-coupled.

Hitbox is a Node wrapper around bump that makes it easy to detect and resolve collisions.

See also the singletons for accessing and changing game-wide state: Input, Window, Debug and Camera.

/lib/

Libraries for common operations. Submodules are included for:

  • anim8 - Easily transforms spritesheets into animated objects.
  • baton - Abstracts raw inputs into "actions" which can then be checked, altered or replaced.
  • batteries - A better "standard library" for LÖVE games. Has utilities for math, sequencing, timing, vectors and more.
  • bump - Collision detection and resolution for axis-aligned bounding boxes (AABBs).
  • classic - Tiny, battle-tested class module for object orientation.
  • gamera - A camera system.
  • hump - General-purpose utilities for LÖVE. This template mostly uses it for its timing and tweening functions.
  • inspect - Renders tables in a human-readable way.
  • log.lua - A tiny logging module.
  • moses - An "utility belt" for functional programming; makes it much easier to operate upon tables.
  • push - Easy window resolution handling.

/assets/

This is where static resources - data that doesn't change during the game - should go. Images, audio, fonts, but also things like Lua tables and Tiled maps.

Included collections:

Globals

To cut down on repeated requires, several globals are provided by default. They can be safely disabled by removing the line require("globals") from main.lua.

See a full list in globals.lua.

Contributing

Issues, pull requests and suggestions are welcome. You can poke me in the LÖVE Discord server.

License

Original code and assets have a MIT License, see LICENSE.md for details.

All libraries and their licenses have been included as-is (see /lib/).

Please preserve the credits.txt file, as some assets require attribution.

About

Godot-flavored template for LÖVE games

Resources

License

Stars

Watchers

Forks

Contributors