LÖVE: 2D Game Framework for Lua
202 points
1 day ago
| 19 comments
| github.com
| HN
patapong
5 hours ago
[-]
One of the biggest recent indie hits, Balatro, was made in Löve!

I really like it, the developer experience is so smooth for beginners, just drag a zip onto the exe and it starts. And the APIs are simple enough to memorize while allowing pretty cool rendering stuff.

reply
KeplerBoy
5 hours ago
[-]
Balatro ships with the entire unobfuscated Lua source by the way.

I once checked if the odds stated on a card were implemented wrong. Turns out no, the code checks out, I'm just that unlucky.

reply
__s
5 hours ago
[-]
too bad universe doesn't ship with unobfuscated source so that you could see whether you're unlucky, or just skill issue
reply
Tepix
5 hours ago
[-]
The source is right there, you just have to grok it.
reply
Sardtok
3 hours ago
[-]
Well, it's kind of a machine code for a self-modifying compiler, so there's that.
reply
brooke2k
5 hours ago
[-]
hahaha, I did the exact same thing after the game came out to see if wheel of fortune was really a 1/4 chance
reply
mh-
5 hours ago
[-]
lol, love seeing that I'm not the only one who did this. Being suspicious of WoF was the first and last time I peeked at the Balatro source.
reply
QuantumNomad_
4 hours ago
[-]
Game developers sometimes make the “randomness” favor the player, because of how we perceive randomness and chance.

For example in Sid Meier’s Memoir, this is mentioned.

Quoting from a review of said book:

> People hate randomness: To placate people's busted sense of randomness and overdeveloped sense of fairness, Civ Revolutions had to implement some interesting decisions: any 3:1 battle in favor of human became a guaranteed win. Too many randomly bad outcomes in a row were mitigated.

https://smus.com/books/sid-meiers-memoir/

Some threads on randomness and perceived fairness in video games can be found here on HN too, for example https://news.ycombinator.com/item?id=19399044

The original link being discussed in that thread is 404 now, but archived copies of the original link exist such as for example https://archive.is/8eVqt

reply
bsimpson
32 minutes ago
[-]
Dispatch too. If your odds are above a certain threshold, the mission is a gimme.
reply
addandsubtract
2 hours ago
[-]
I think XCOM does this as well.
reply
lovehashbrowns
3 hours ago
[-]
The 8-ball joker is even more BS. I think I’ve only seen it trigger once ever.
reply
mh-
3 hours ago
[-]
I've read the source a few years back. It's all implemented fairly as it says on the tin.

I've long been suspicious of the RNG/seed implementation.. but not curious enough to automate testing of it, though.

reply
StilesCrisis
25 minutes ago
[-]
It's been done, it's a valid RNG. It's somewhere on Reddit if you want to try and search for it.
reply
mh-
22 minutes ago
[-]
I figured it had been tested by someone more motivated than me, haha, thanks! Will look for it when I'm back at a computer.
reply
andrepd
2 hours ago
[-]
Neat example of cognitive bias, the brain perceives the Nope as being much more prevalent than it actually is!
reply
tertle950
2 hours ago
[-]
For a small while I've had the idea of a [game engine/fantasy console/Scratch clone?] that comes packed with a bunch of example games. The example games should be good enough that people download it just to play them, but they are also encouraged to peek into their source code. I'd hope for it to be a sneaky gateway into programming.

For that, I'll keep this in mind: "Unlucky players may look at the source code of a chance-based effect to check if the odds are actually as stated."

reply
sfn42
3 hours ago
[-]
I didn't know I could check but after losing like 20 times in a row I just stopped taking WoF. Never saw the good outcome.
reply
Levitating
3 hours ago
[-]
Not on steam does it? I can only see the exe and dlls.
reply
jared0x90
3 hours ago
[-]
extract the exe like a zip file, that's how love packages itself. last i looked at the source myself it had comments in still from the dev
reply
bsimpson
27 minutes ago
[-]
I'm really curious how they do version control.

The Steam version was created by one guy, but the platform ports have a couple different authors. The Google Play and Xbox PC versions, for instance, have divergences.

I wonder how the ports influence the upstream and each other. How do they keep the codebases in sync, while also accounting for platform differences?

reply
Levitating
3 hours ago
[-]
yep that works
reply
bsimpson
4 hours ago
[-]
In case you're curious, here's a Nix derivation to make Balatro for any other system playable on Linux:

https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name/ba...

I wrote half a blog post when I did the derivation. One day, I should finish it and post it here.

reply
pmarreck
1 hour ago
[-]
That's awesome!
reply
eek2121
2 hours ago
[-]
A lot of indie devs actually are fine with decompiling/viewing source. Even the STS2 devs have no issue with this. I think it is great and helps the indie dev community. Seeing this has actually made me excited about game dev to the point where I'm beginning to dig in myself.
reply
Neywiny
3 hours ago
[-]
Haven't used it in almost 10 years but at least back then one sticky point was that unlike unity and the like, opening the exe didn't open an IDE. Just kind of a dummy window. Also building for Mac from Windows was a nightmare since my end user was not technically literate and it didn't just run on their end. But that's likely just a Mac issue
reply
nebula8804
1 hour ago
[-]
Anyone who is a fan of the TV Show Community MUST try out the recreation of the 8 bit video game episode(Digital Estate Planning) called Journey to the Center of Hawkthorne.

[1]: https://projecthawkthorne.com/

It is now available to play straight in the browser(I guess using LÖVE Web Builder?).

[1]:https://schellingb.github.io/LoveWebBuilder/

This engine has really come a long way and enabled such a memorable game for me.

reply
wwarren
6 hours ago
[-]
I love LÖVE. For me it sits at the perfect intersection between high and low level abstraction. Unfortunately the latest released version is getting pretty long in the tooth now and a lot of devs use the latest HEAD from the repo since it has better performance and compatibility. One day the mythical 12.0 will get released for real…..
reply
hu3
2 hours ago
[-]
You might like MonoGame. Same level of abstraction, but in C#.

https://monogame.net

reply
tertle950
1 hour ago
[-]
Since we've stepped from interpreted language (Lua) to compiled-to-VM language (C#), let's go all the way down to compiled, low-level language (C) with Raylib!

https://www.raylib.com/

reply
PacificSpecific
5 hours ago
[-]
I generally very much dislike dynamic languages but for some reason I've always really liked Lua. I'm not exactly sure why to be honest.

Maybe because you can fit the whole language spec on a single sheet of paper and adding more advanced features is pretty easy.

Love looks really cool. I never got into it personally but I still might

reply
turtledragonfly
3 hours ago
[-]
The Lua source code is also a masterclass in C, I recommend it to anyone learning that language. It's big enough to be an involved implementation, but small and focused and well-organized enough to (at least roughly) understand what's going on at the various layers. It's a very solidly-written mass of portable C, with only minor exceptions.
reply
PacificSpecific
3 hours ago
[-]
Oh I hadn't considered looking at the source but considering how minimal and clean Lua is I should have assumed so :)

Thanks for the tip. That should make for a fun weekend

reply
Kaliboy
2 hours ago
[-]
Lua will forever hold a special place in my heart. It was the first programming language that I actually managed to learn, instead of just attempting to learn it.

It was chosen around 2008 or so to be the scripting language in Multi Theft Auto: San Andreas.

We build entire worlds in Lua, there were many gamemodes, but my favorite was Roleplay.

Good old carefree times.

reply
yehoshuapw
6 hours ago
[-]
my favorite game in love: mario, with portals

https://stabyourself.net/mari0/

reply
seqizz
5 hours ago
[-]
I looove stabyourself. ortho robot was amazing. you know what, let me install again.. here goes my night.
reply
jgtrosh
4 hours ago
[-]
I like the Trosh game
reply
ranger_danger
4 hours ago
[-]
How have they not been sued by Nintendo yet?
reply
mid-kid
3 hours ago
[-]
Same reason all the other mario flash games haven't, not a critical enough mass.
reply
K0IN
5 hours ago
[-]
I love löve I did some projects in it, lua was one of my fist programming language, i think it's a great fit for game dev.

Also move or die is running on love2d, which is an awesome game.

Also I love that trick that you can just zip your files and binary Comcast them to the love2d binary and it will load it.

reply
raincole
5 hours ago
[-]
Btw, Love2D is based on SDL2. If you hate Lua but needs the same cross-platform capabilities, you can use an SDL2 binding in other languages or make your own.
reply
Levitating
2 hours ago
[-]
SDL3 should get more love in general.

The SDL3 GPU API[1] provided a cross-platform GPU API even before WebGPU.

In Rust it's a good alternative for winit/wgpu. For that reason I added it to areweguiyet.com[2] last week, where apparently it wasn't even listed before.

I am currently using it to develop a space game[3] inspired by the original BBC Elite. Using emscripten to get on the web and QUIC/Webtransport for networking.

[1]: https://wiki.libsdl.org/SDL3/CategoryGPU

[2]: https://areweguiyet.com/#ecosystem

[3]: https://git.levitati.ng/LevitatingBusinessMan/elite/src/bran...

reply
hresvelgr
1 hour ago
[-]
SDL3 doesn't support bindless resources and the plans to do so in the future are very loose[1].

[1] https://github.com/libsdl-org/SDL/issues/11148#issuecomment-...

reply
onehair
3 hours ago
[-]
Now why would you hate lua of all things?
reply
raincole
3 hours ago
[-]
For all the reasons, but the 1-based index alone makes me uncomfortable.
reply
WolfeReader
53 minutes ago
[-]
1-based indexing is great. It's just _different_ - from C, where the array index is just sugar for pointer arithmetic, and from other languages which borrowed the practice without reasoning.
reply
onsclom
3 hours ago
[-]
I don't necessarily hate Lua, but I prefer C and Raylib for game dev. Lua is garbage collected, dynamically typed, strays far from standard syntax patterns, and has less existing tooling than C.

I see why people might hate Lua. Especially for game dev!

reply
krapp
2 hours ago
[-]
Lua is extremely popular for game dev though?
reply
CyberDildonics
2 hours ago
[-]
There is a lot more that goes into Love2D than just SDL. It uses many other libraries for sound, image loading, etc as well as using luajit so that the lua runs very fast and has a super easy C FFI.
reply
Levitating
2 hours ago
[-]
But SDL already provides an API for all the things you listed. So I am assuming the libraries in Love2D still call those underlying SDL APIs right?
reply
CyberDildonics
2 hours ago
[-]
Love2D uses openAL for audio, FreeType 2 for fonts, DevIL for image loading and Box2D for physics. It can also use image fonts. It uses luasocket for networking and has a compression API built in.

On top of that there are love2d specific libraries people have written to deal with 2D games like GUIs and tile libraries.

Then there is the ease of debugging, where you can use lua to have runtime access to the table of variables and can print them on screen if you need to, not to mention dynamically loading new update and draw and input functions.

This is all to say that just downloading SDL is not going to get anywhere close to what love2d has included.

reply
newobj
5 hours ago
[-]
SDL3
reply
jasonjmcghee
5 hours ago
[-]
Definitely SDL2.

Author is currently building version 12 which will be using SDL3. But it's been in development for quite some time with no clear end date afaik.

reply
newobj
40 minutes ago
[-]
I stand corrected!
reply
krapp
4 hours ago
[-]
It is easy to get Lua (with LuaJIT) working with SDL3, though.

That obviously isn't a replacement for the framework but it is perfectly doable if someone just wants to write a game in Lua with minimal overhead.

Edit: I mention LuaJIT specifically because it lets you create metaclasses around C objects, which is much easier than messing with the Lua stack from C, and it's easy to make a 2d vector class from an SDL Point or a spritesheet or what have you. There are a few rough edges like dealing with pointers and gc but to me it's the best of both worlds (the speed of C, and some implicit type checking, and the flexibility of Lua.)

Obviously you could do it the hard way and the other way around with normal modern Lua but it's such a pain in the ass.

reply
raincole
4 hours ago
[-]
As far as I know only the latest (unstable) version uses SDL3.
reply
JSR_FDED
1 hour ago
[-]
Lua is very fast - even without the JIT it makes Python feel like wading through molasses.

Lua is so small and simple (but not simplistic) that you can keep it completely in your head. Even if you only get to work on your project once every weekend you won’t have to relearn half of it every time.

reply
chadpaulson
1 hour ago
[-]
I love this framework, pun intended. I made a clone of Atari's Missile Command with it many years ago when the Portal / Mario mashup game made with LÖVE was popular. https://github.com/chadpaulson/missile-command
reply
0xCAP
5 hours ago
[-]
My2c. Fintech tech lead who has only a far memory of hand coding games ages ago. Community makes tech awesome. Love2D discord changed my life. Never met a more awesome and welcoming community in my whole life.
reply
p2detar
6 hours ago
[-]
As someone that used to write 2D games with things like phaserjs, sdl and even directx7, I always regret I never tried Löve2d. I think Android and iOS packaging was also supported. Is this still the case? What if one wants to integrate IAP?
reply
1313ed01
2 hours ago
[-]
Pretty sure there is still app packaging documented somewhere. There is also, at least for Android, an official Löve2D Launcher app that can open any love-file saved to the phone and execute it. I use that all the time.

The Launcher is available also for old Android versions, which means that old obsolete Android devices (I have some tablets and phones) can be used for whatever it can be fun to still write some GUI for on some spare touchscreen device.

reply
pmarreck
1 hour ago
[-]
I need something like this but for cross platform utilities
reply
vslira
1 hour ago
[-]
I haven't done it myself, using game engines as UI frameworks is not unheard of :)
reply
alprado50
3 hours ago
[-]
Is Love2D a decent option for gamedev compared to Godot? I finished a really simple game using Unity3D and it was fun, but it sucks to use a closed source engine.
reply
CJefferson
40 minutes ago
[-]
It’s very different, and it depends what you are targeting. I love love2d.

I think love2d is better if what you love is coding, everything is code, love2d just executes Lua.

If what someone wants to do is make (for example) a 2d platformer, or definately for 3d, and the coding is something you need to do to make your game, goody is better, it includes so many batteries, have a built in gui level editor, etc.

One big advantage of love2d (although ironically not loved by many in its audience) is it is the AI friendly engine, as AIs love text and hate GUIs.

reply
onehair
3 hours ago
[-]
Godot will be familiar to you if you then.

Löve on the other hand is 100% just code. You'll not have the gui things and the pletora of different components that go with them. Still gives you freedom. Just too much freedom and not as much helpful preset tools.

reply
jtolmar
2 hours ago
[-]
Yeah, Love2d is a great option for gamedev. It doesn't have the same built-in tools as Godot so you'll need something else for putting together maps (use Tiled [1]), and you'll need to write your own main/render loops (these are just two for loops, nothing fancy).

[1] https://www.mapeditor.org/

reply
herczegzsolt
6 hours ago
[-]
I've used this for many projects that are still working to this day.

That said, i'm not impressed. A web-based solution is usually better performing, despite all the bloatware necessary. This says a lot about the state of software development unfortunately.

reply
tertle950
2 hours ago
[-]
I'm curious as to how you came to that conclusion. Did you run any tests, or is it just a general observation? What's your computer hardware like? This isn't an accusation of anything, I promise I'm genuinely curious.
reply
actuallyalys
3 hours ago
[-]
I don’t usually push LÖVE to its limits because I tend to make simple games as a hobby but I do keep an eye on its framerate and often it‘s in the 100s of frames per second. So it may not be impressive (in sense of winning benchmarks) but it’s rarely perceivably slow.
reply
small_scombrus
5 hours ago
[-]
It isn't web based? It's a set of Lua scripts that run locally
reply
squeaky-clean
5 hours ago
[-]
They are saying web based solutions often out perform LÖVE, even though you would expect the opposite because LÖVE doesn't have the bloat of a browser engine.
reply
usrnm
5 hours ago
[-]
Browser engines are probably some of the most optimized pieces of software in existence, so it doesn't surprise me at all.
reply
wiseowise
3 hours ago
[-]
Explain this to electron haters.
reply
QuadmasterXLII
2 hours ago
[-]
step 1 htop

there isnt step 2, explain is over

reply
krapp
2 hours ago
[-]
Browser engines are optimized for displaying web pages, not for applications.

60MB+ for a calculator is not optimal.

reply
hu3
2 hours ago
[-]
explain that to my webgl TypeScript browser game running at 180+ FPS while rendering a large RPG tiled world with infinite procedurally JIT generated biomes, with heavy processing delegated to webworkers.
reply
krapp
2 hours ago
[-]
As you aren't posting code or stats I can't say much, but I'd bet a native app would still be smaller and more efficient, since you have to wrap what you're doing in an entire Chromium instance and deal with a web stack designed for documents, which is definitionally less efficient than a native alternative. Tiles aren't exactly cutting edge technology.

"Heavy processing delegated to webworkers?" That just sounds like threads but worse.

reply
CyberDildonics
2 hours ago
[-]
Love2D uses Luajit and directly calls established game libraries. The CPU usage should be far better for 2D games, luajit is faster than a browser's javascript jit. You can also create single exe games that are a few megabytes and not a few hundred megabytes.
reply
nout
4 hours ago
[-]
Am I really the first one to mention pico8 in this thread? Anyway, pico8 is another option that has a bit different spin, but you also implement the games in Lua :)
reply
opan
3 hours ago
[-]
TIC-80 is a nice free as in freedom alternative to PICO-8, and it allows more inputs, which makes for better Tetris games (gotta have that hold piece).
reply
nout
26 minutes ago
[-]
It's just that pico8 has much larger ecosystem. There's a new great game almost every day. It is sort of annoying that it's not FOSS, but on the other hand the team/author has sustainable business.
reply
tertle950
2 hours ago
[-]
Is this about Master of Blocks?

There are a lot of free-as-in-freedom alternatives to (and clones of) PICO-8, but TIC-80 is indeed the most popular one, by far. And popularity is important for any software ecosystem. I really like that it supports other languages, even if that kinda inhibits its ability to be embedded into small hardware.

Apparently the nightly release supports DCPM samples now. Dunno why.

reply
1313ed01
2 hours ago
[-]
Was going to post a link to the minimal template for setting up Löve2D with Fennel, that I can really recommend, and found this recent article describing that...

https://itch.io/jam/love2d-jam-2026/topic/6082771/how-to-get...

... posted in the site of the 2026 Löve2D Game Jam, that sounds like something also worth mentioning: https://itch.io/jam/love2d-jam-2026

Too late to enter. Jam was last month. But there are 47 games to check out there, plus many from previous years.

reply
VorpalWay
3 hours ago
[-]
How is it supposed to be pronounced? Is it just gratuitous diacritics? Or should I pronounce it in my native Swedish (where the names makes me think of leaves rather than love)?

(Throwing diacritics on English words look extremely silly to me, since I know how åäö are supposed to be pronounced. It makes something like Motorhead just sound laughable rather than metal.)

reply
Sardtok
2 hours ago
[-]
The project was started by Norwegians. So I feel like you should apply juuuust the right amount of cheesiness and sort of push that Ø-vowel looong. Not sure if Ruud would agree, though.
reply
anthk
2 hours ago
[-]
UXN can be interesting for 2D games too.
reply
tertle950
2 hours ago
[-]
The fantasy computer by 100 rabbits? I love their philosophy, I'm glad Varvara exists, but I'm personally not up to program assembly for a 4-color screen, and I'm sure many others are the same.
reply
davidkunz
5 hours ago
[-]
I haven't tried Löve, but I somehow enjoyed reading through the README.md, no AI slop, just a natural writing style with tiny indictors showing the authors' enthusiasm in creating software.
reply
Sardtok
2 hours ago
[-]
The project predates Github, although the first official release came out about a month prior. So, yeah, not a lot of AI slop 20 years ago.
reply