Questions tagged [love2d]

Love2D is a framework for scripting 2D games in Lua. It has cross platform support for Windows, Linux, Mac OS X, Android and iOS.

LÖVE is a free, multiplatform, Lua framework for creating 2D games; LÖVE is distributed under the very permissive zlib/libpng license, allowing its use for commercial purposes.

Overview and Features

LÖVE is implemented in modular C++, using Lua 5.1 as its user-facing scripting language.
Some of its more notable features include:

  • Mainline support for Windows, Linux, and Mac OSX.
  • OpenGL accelerated 2D
  • GLSL Shaders
  • Lua 5.1 scripting support
  • Game packaging and self-running packages. ('.lovechives', and 'merged binaries')
  • Image formats: PNG, JPEG, TGA, BMP, (et al.)
  • Audio formats: WAV, OGG, MP3, MOD, (et al.)
  • Archive formats: ZIP, 7ZIP, (et al.)

Resources and Community

Related Tags:

653 questions
17
votes
4 answers

Can I compile LÖVE games into EXE files and sell them?

I've got two questions about LÖVE. Can I sell what I make in LÖVE? Can I compile anything I make into an EXE file?
Freesnöw
  • 30,619
  • 30
  • 89
  • 138
12
votes
0 answers

Which Haskell GLSL binding supports multiple framebuffers?

I'm trying to implement two pass Gaussian blur using GLSL with Haskell and I don't know which library should I use to achieve result similar to the Löve2D Lua code presented below: Löve2d code (main.lua) LG = love.graphics function love.load() …
Korri
  • 199
  • 5
8
votes
1 answer

How to create a walking animation in LOVE 2D

So I was wondering how to change an image of character I've created depending on the key I've pressed/am pressing? My ultimate going to to have a walking animation occuring when "d" (or any of the wasd keys) is pressed but then he stands still when…
Switchkick
  • 2,716
  • 6
  • 21
  • 28
8
votes
2 answers

Pixel Collision Tracing

I have a character that's say, 20 by 10 pixels large and I have a collision map based on pixels (think worms). What's the best way to trace collision for the character given a velocity greater than 1 pixel per frame. Is there a solution better than…
Fascia
  • 732
  • 6
  • 17
7
votes
1 answer

How to debug Lua Love2D with VSCode?

I'm looking for suggestions on how to debug Lua Code in Visual Studio Code. I'm using Love2D, so I understand that I will somehow need to embed my debugging code, because it is not standalone Lua, however I would prefer a minimal augumentation of my…
Sewbacca
  • 576
  • 6
  • 17
7
votes
1 answer

Can I save into a specific folder?

While learning how to create Lua file output code with the support of LÖVE, I've always hated that LÖVE filesystem handler always saved the specific file somewhere in C:/Documents and Settings/... How can I create a code that saves a file into a…
Zoltán Schmidt
  • 1,286
  • 2
  • 28
  • 48
7
votes
1 answer

Is it possible to call loadstring on string of lua bytecode that contains a reference to a C function?

We are using the Love2d Lua game engine that exposes a graphics api to Lua. We are trying to serialize a giant hash table that contains all the save game data for the game world. This hash includes some functions, and some of these functions call…
davidscolgan
  • 7,508
  • 9
  • 59
  • 78
6
votes
1 answer

Love2d and radial gravity

I've found an interesting article on adding radial gravity to box2d. http://www.vellios.com/2010/06/06/box2d-and-radial-gravity-code/ To port this to lua though I need to calculate distance squared and normalize distance. Love2d doesn't seem to have…
Joseph Le Brech
  • 6,541
  • 11
  • 49
  • 84
5
votes
1 answer

How to display debug info or console.log equivalent in Lua

I am creating many games using Lua and LOVE2D, but whenever I implement a new function and want to test it out, or simply want to know a value of a variable in Lua, I either display it on the game screen or just hope that it works. Now my question…
Rajat Shenoi
  • 590
  • 2
  • 7
  • 22
5
votes
3 answers

Love2D: what is the difference between creating variables inside love.load instead of at the top of the main.lua file?

If you look at the docs for love.load it says This function is called exactly once at the beginning of the game. and nothing else really. Also it has one parameter, which are command line args. So if you don't use the args, what is the difference…
m0meni
  • 16,006
  • 16
  • 82
  • 141
5
votes
1 answer

Lua error to create a class

I'm trying to create a class for my game and I got this error (shown in love2d): attempt to index upvalue 'World' (a boolean value) This is my World file I made: local World = {} World.__index = World function World:new(meter, gravity) …
Jazzguy
  • 147
  • 1
  • 11
5
votes
2 answers

Lua - Perlin Noise Generation - Getting bars rather than squares

I'm currently learning Löve 2d/Lua and trying my hand at generating noise using the Perlin Noise algorithm. I've adapted Ken Perlin's Improved Noise code here: Code edited with fixes per Doug's answer -- original code by Ken Perlin:…
GHandel
  • 172
  • 2
  • 3
  • 13
5
votes
1 answer

2D Line reflection on a "mirror"

So I've been working at this on and off for a week, googling and all and I haven't found how to do this. I have a table of "rays" and a table of "lines", and I want the lines to act as mirrors and reflect a ray whenever the ray hits a line. Imagine…
Lucas Watson
  • 763
  • 1
  • 8
  • 26
5
votes
1 answer

Lua 2D array error

So I am fairly new to Lua, and in other languages I have been able to create a 2D array of variables and simply index through the array in order to create a tiled map. Whenever I try this in lua I get an error (specifically an error stating that I…
devCorner
  • 193
  • 4
  • 15
4
votes
3 answers

Is there a way for me to avoid using a global variable here?

So I just started learning Lua and Love2D and am using global variables when I need callback functions to communicate with eachother. For example: enter_pressed = false function love.update(dt) if love.keyboard.isDown('return') then …
Francisco
  • 41
  • 1
1
2 3
43 44