Page 1 of 1

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

Posted: Thu Jan 25, 2018 11:50 pm
by Lignum
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.

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

Posted: Mon Apr 09, 2018 9:29 pm
by eitanbron
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!!!

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

Posted: Wed Jul 26, 2023 9:28 am
by olegharput
Where is setViewport (set-viewport) in these bindings, I can not find it.