## urn-love2d-bindings - Write Löve2D games in Lisp!

Lignum
Prole
Posts: 1
Joined: Thu Jan 25, 2018 11:22 pm

### urn-love2d-bindings - Write Löve2D games in Lisp!

These are bindings for Löve2D for the Urn programming language, which is a self-hosting Lisp that compiles to Lua. It outputs single, mostly readable, dead code-eliminated, fully self-contained Lua files, making it easy to use within any context.

You may find the bindings on GitLab.
If you're using Arch Linux, you can get this library, as well as Urn, from the AUR (not maintained by me).

To get started, simply follow these steps:
Run these commands:

Code: Select all

mkdir my-project
cd my-project
git clone https://gitlab.com/Lignum/urn-love2d-bindings.git love

Create a file game.lisp with these contents:

Code: Select all

(import love/love (defevent))
(import love/graphics)

(defevent :init ())
(defevent :draw ()
(love/graphics/print "Hello World!" 64 64))

Now, assuming "urn" is the Urn compiler, run this:

Code: Select all

urn game.lisp -o main

The Urn compiler will now have created a self-contained main.lua file, which we can run with Löve2D as usual:

Code: Select all

love .

If everything worked correctly, you should be able to see a window with the text "Hello World!", as expected.

Further useful information:

To prove this library works in practice, I've written a basic Pong example with these bindings, which you can find and learn from here.

GitHub user paines has figured out how to use lovelive to live compile Löve2D games with Urn.

eitanbron
Prole
Posts: 4
Joined: Thu Mar 02, 2017 11:23 am

### Re: urn-love2d-bindings - Write Löve2D games in Lisp!

This is majorly cool. It is also the first time I managed to get anything game related to work in a Lisp language. If there is any way I could help in developing this project I would love to contribute. Thank you so much!!!

### Who is online

Users browsing this forum: No registered users and 5 guests