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
3
votes
1 answer

Why does LuaJIT produce a "too many callbacks error" from this simple code?

I'm using LuaJIT and running into a "too many callbacks" exception with this code. I know there is a limit to the number of c callbacks that can be generated, but as far as I know, this should just generate one callback... right? ffi =…
3
votes
1 answer

call a function from inside a table that's inside another table in lua

I am attempting to build my first game using love2D, I have hit a problem. The game is a bubble popping game, I want to assign a bubble to each letter on the keyboard so that when a letter is pressed, the bubble will pop. I have an external file…
Jamie McAllister
  • 729
  • 2
  • 11
  • 33
3
votes
1 answer

How to initialize a table with tables in Lua?

A friend and I try to write a mine sweeper program in Lua using the Löve framework. So far the code needs to see if a box (a cell) is checked and then draw it. We are new to Lua, the program now has the flaw that it only works on the lower right…
user2609980
  • 10,264
  • 15
  • 74
  • 143
3
votes
1 answer

Passing an array name to a function, then populating it

I would like to call a function that takes data and then populates an array I name in one of the function parameters. Example of what I'm looking for: function readSaveFile(saveFileName, arrayName) if love.filesystem.exists(saveFileName) then …
3
votes
1 answer

Lua: attempt to call global 'rectangle_draw' (a nil value)

I have two Lua files, one of which is main.lua: require "player" require "level" function love.load() end function love.draw() rectangle_draw() end and another called player.lua: function rectangle_draw() love.graphics.setColor(223, 202,…
Yliaho
  • 117
  • 4
  • 10
3
votes
2 answers

Pure Lua hashing method

This has been bothering be for a while now, I cannot seem to find a pure Lua implementation of a popular hashing method like SHA256, SHA512, or Whirlpool. I need it as I will be hashing the password client side before sending it of to a server.…
Bicentric
  • 1,263
  • 3
  • 12
  • 12
3
votes
2 answers

Love2D/Lua Animation system and tables

Hy there! currently i'm working on a "simple" animation system for my game. And i have some problems with tables. I made a settings file, to load the informations of the animations (to be specific, it loads the alias of the animation, and the number…
neonoxd
  • 57
  • 7
3
votes
4 answers

Lua class objects?

I'm new to Lua and I'm wondering if there's a way to make many class objects to make different items in my case like in a OOP language like C# or Java. An example of what I'm saying is a class like this in Lua... weapon = {} function…
freemann098
  • 284
  • 1
  • 7
  • 22
3
votes
2 answers

Using Lua tables as 2-dimensional arrays

I'm a beginner Lua user, I attempt to create something in Lua by using Love2D libraries. In the loading function I create a table and upload it with elements (which are numbers) for use it later as a multidimensional array. function love.load() …
Zoltán Schmidt
  • 1,286
  • 2
  • 28
  • 48
3
votes
1 answer

Changing what is in the love.load function

My friend and I have been working on a game in love2d recently, but in the early stages of developing my computer hard drive stopped working meaning only my friend could work on it. Now I have a computer and I want to make a main menu in Love2d but…
Cj1m
  • 805
  • 3
  • 11
  • 26
3
votes
1 answer

Rectangular collision system not working in love2d

I'm trying to create the base architecture for managing objects and collisions in a simple game in the Love2d framework. All of the objects are stored in a table (objects:activeObjects) and then a loop in the objects:calculateCollisions() function…
teasplurt
  • 33
  • 4
3
votes
5 answers

Love2d Rotating an image

I would like to rotate an image in Love2D. I have found a documentation on love2d.org: https://love2d.org/wiki/love.graphics.rotate But I can't seem to get it to work when I try to load an image. Heres my code: local angle = 0 function love.load() …
Dallox
  • 487
  • 5
  • 8
  • 19
3
votes
3 answers

making a menu in love2d

I'm currently working with the love2D game engine and am curious how to create just a simple user menu. Maybe just with a few options such as: Play, options, about, exit. Are there any good tutorials out there for creating a custom game menu? I just…
cj1098
  • 1,560
  • 6
  • 32
  • 60
2
votes
2 answers

Modular code structure in Lua

I've been working with Love2d recently to build a Conway's Game of Life implementation. I really like the framework, but I haven't been able to figure out how to modularize my code, which I feel is crucial to solid code structure. What I'm wanting…
Benjamin Kovach
  • 3,190
  • 1
  • 24
  • 38
2
votes
2 answers

Developer Console love2d

So I found on github this library for love2d that adds a developer console into my game so I followed that steps and got stuck at this one, it says: "In the love.textinput function add the following line (console_toggle(text)), text should be…
Jacket
  • 33
  • 3