General Category > General Game and Application Development

About LÖVE (Love2D)

(1/2) > >>

Kryzon:

--- Quote from: https://love2d.org/ ---LÖVE is an *awesome* framework you can use to make 2D games in Lua. It's free, open-source, and works on Windows, Mac OS X, Linux, Android and iOS.
--- End quote ---
I've been having a lot of fun with it, definitely recommend it for 2D games, even for production. 
It's very lightweight, low CPU use (it's bundled with LuaJIT so on desktop platform your scripts get JIT'ed to native instructions). 

If you have experience with games programming then most of the learning curve is just learning the Lua syntax, because the engine API is simple using callbacks, and you can still rewrite the entire mainloop to have complete control over it. The documentation is great too. And it's zlib licensed.

Here's some tiny projects that I've done with it: 


 
https://github.com/RNavega/2DMeshAnimation-Love2D 



 
https://github.com/RNavega/PixelArt-Antialias-Love2D 



 
https://github.com/RNavega/ScreenWipeShader-Love2D 


MikeHart:
NICE! I love the animated2dmesh example. Can you explain it a bit? Is this a buildin feature of Löve or something you came up with?

MrmediamanX:
I can remember using Love2d awhile ago ... just couldn't get use to it, not that it's bad.
look's like it's gone through a few updates since.

Kryzon:

--- Quote from: MikeHart on September 19, 2020, 10:40:18 AM ---NICE! I love the animated2dmesh example. Can you explain it a bit? Is this a buildin feature of Löve or something you came up with?

--- End quote ---
Thanks man! It works like this: besides images/sprites and geometrical primitives like lines/rectangles/ovals, it also lets you create generic low-level "Mesh" drawables, where you can specify vertex format, vertex attributes etc., set a texture and draw it to the screen.

That example shows how you can animate that mesh by either modifying its vertices on the CPU, or sending all the data needed to a vertex shader and doing it on the GPU (which on my integrated, low-end GPU is still 10x faster than CPU). So it uses the built-in Mesh drawables, but the animation part is done by the script in the fastest way that I profiled. 
A secondary goal was to find a way to get a mesh made and animated on Blender (there's an exporter script in that repo to export the scene as Lua script with data tables). 

There's a Spine library for importing animations made with Spine, but judging from the source, the method they use to animate the mesh is not the fastest.

In order to run these examples you need to download the love executable (more info here), extract it anywhere or use the installer if you prefer it that way, then from a command-line run love.exe with the path to either a ".love" package (a renamed ZIP archive with all the scripts & assets) or the path to a folder with a "main.lua" script inside.

So to run the 2D mesh example, download its .love package from here and then do a:

--- Quote ---D:\path\to\love.exe "D:\path\to\2DMeshAnimation_v1.1.0.love"
--- End quote ---
Or if you downloaded the source files, running from a folder: 

--- Quote ---D:\path\to\love.exe "D:\path\to\2DMeshAnimation-Love2D-master\"
--- End quote ---
The pixel art shader example is the only one that doesn't have a .love, only the main.lua script, so you need to put it in some folder and use that folder-style execution.

When distributing your game on Steam and such, there are more elegant ways of packaging your game: 
https://love2d.org/wiki/Game_Distribution


--- Quote from: MrmediamanX on September 19, 2020, 10:47:58 AM ---I can remember using Love2d awhile ago ... just couldn't get use to it, not that it's bad.
look's like it's gone through a few updates since.

--- End quote ---
It's on v11.3, and it looks like v12 is coming soon. I don't know much of its history but you're probably right that it's changed a lot.

MikeHart:

--- Quote from: Kryzon on September 19, 2020, 12:35:52 PM ---
--- Quote from: MikeHart on September 19, 2020, 10:40:18 AM ---NICE! I love the animated2dmesh example. Can you explain it a bit? Is this a buildin feature of Löve or something you came up with?

--- End quote ---
Thanks man! It works like this: besides images/sprites and geometrical primitives like lines/rectangles/ovals, it also lets you create generic low-level "Mesh" drawables, where you can specify vertex format, vertex attributes etc., set a texture and draw it to the screen.

That example shows how you can animate that mesh by either modifying its vertices on the CPU, or sending all the data needed to a vertex shader and doing it on the GPU (which on my integrated, low-end GPU is still 10x faster than CPU). So it uses the built-in Mesh drawables, but the animation part is done by the script in the fastest way that I profiled. 
A secondary goal was to find a way to get a mesh made and animated on Blender (there's an exporter script in that repo to export the scene as Lua script with data tables). 

There's a Spine library for importing animations made with Spine, but judging from the source, the method they use to animate the mesh is not the fastest.

In order to run these examples you need to download the love executable (more info here), extract it anywhere or use the installer if you prefer it that way, then from a command-line run love.exe with the path to either a ".love" package (a renamed ZIP archive with all the scripts & assets) or the path to a folder with a "main.lua" script inside.

So to run the 2D mesh example, download its .love package from here and then do a:

--- Quote ---D:\path\to\love.exe "D:\path\to\2DMeshAnimation_v1.1.0.love"
--- End quote ---
Or if you downloaded the source files, running from a folder: 

--- Quote ---D:\path\to\love.exe "D:\path\to\2DMeshAnimation-Love2D-master\"
--- End quote ---
The pixel art shader example is the only one that doesn't have a .love, only the main.lua script, so you need to put it in some folder and use that folder-style execution.

When distributing your game on Steam and such, there are more elegant ways of packaging your game: 
https://love2d.org/wiki/Game_Distribution


--- Quote from: MrmediamanX on September 19, 2020, 10:47:58 AM ---I can remember using Love2d awhile ago ... just couldn't get use to it, not that it's bad.
look's like it's gone through a few updates since.

--- End quote ---
It's on v11.3, and it looks like v12 is coming soon. I don't know much of its history but you're probably right that it's changed a lot.

--- End quote ---
Thanks man, back then and before I got into Monkey, I was using Ansca/Corona SDK and then Gideros Studio A LOT, so Lua is no unknown for me.

Navigation

[0] Message Index

[#] Next page

Go to full version