Small example "freewheeling" app that can be modified without restarting
# Toy night sky written in the "freewheeling" style that can be modified without being restarted

[![0 dependencies!]https://0dependencies.dev/0dependencies.svg]https://0dependencies.dev

This app shows a very simple animation of a rotating night sky containing some
twinkling stars with a subtle oscillation between day and night. It's intended
as an example app for playing with the [the driver app]https://codeberg.org/akkartik/driver.love.

[What is a Freewheeling App?]http://akkartik.name/freewheeling

[There's some reference documentation if you're inspired to create your own apps.]reference.md

## Invocation

Run this app from the terminal, [passing its directory to LÖVE]https://love2d.org/wiki/Getting_Started#Running_Games

## Hacking

To modify it live without restarting the app each time, download [the driver
app](https://codeberg.org/akkartik/driver.love). An example session might look
like this (though the UI of the driver app on the left is improving over
time):

![making changes without restarting the app]assets/20221228-luaML-driver.gif

To publish your changes:
  * delete all files with a numeric prefix from the repo, and then
  * move all files with a numeric prefix from the [save directory]https://love2d.org/wiki/love.filesystem.getSaveDirectory
    to the repo.

## Known issues

* This approach puts one top-level definition per file, and so obscures the
  order in which definitions are loaded. In particular, initializing a global
  table to contain other global definitions will fail if you originally
  authored the other global definitions after the table.

  I never initialize global tables with other definitions. That kind of thing
  happens in `on.initialize` (akin to `love.load`; see reference.md) or
  `on.code_change`.

* Don't start the driver app while multiple freewheeling apps are running. If
  you have a driver app running with one app, shut it down before you switch
  apps.

## Mirrors and Forks

Updates to this repo can be downloaded from:

* https://git.sr.ht/~akkartik/night.love

Further forks are encouraged. If you show me your fork, I'll link to it here.

## Feedback

[Most appreciated.]http://akkartik.name/contact