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

Error main.lua:23: attempt to index upvalue 'Menu' (a boolean value)

I am trying to make a main menu with lua and love2d, this is my first time doing so and sadly there are no tutorials on the matter so I took a shot at it myself. I keep runing into this error and i dont know how to fix it, Please help! Full error…
2
votes
1 answer

The love2d game.exe is not sharp in windows. How to make the game sharp(for pixel game)?

In windows In linux I am a linux user so i was making the game in linux. While developing the game when i compiled the game, it was sharp. For sharping i have used this code love.graphics.setDefaultFilter('nearest', 'nearest'). After completing…
Shubhro
  • 65
  • 6
2
votes
1 answer

Object-Oriented Programming in Love2D(Lua)

I got interested in Love2D and Lua and decided to give it a try. So in order to get familiar both with Lua and Love2D, I code out an easy sample: Project Structure: demo |-ball.lua |-main.lua ball.lua Ball = { x = 0, y = 0, xSpeed…
Kevin Tung
  • 23
  • 2
2
votes
3 answers

Love 2d is not working in my VS Code setup

I have made a new folder to keep my coding files in and folders of Love2D. But since then whenever I press alt+l in my main.lua file in vs code, the file doesn't run in love app. But, when I try to drag and drop the folder of my game onto the…
2
votes
1 answer

Lua inheritance and methods

How to inherit a new class player from class actor and make method actor:new(x, y, s) called in method player:new(x, y, s) with the same parameters. I need to make player:new the same but with additional parameters so the player can have more…
a0405u
  • 45
  • 6
2
votes
1 answer

How to reference an object in a table in Lua by its name

This seems like a very straightforward question, but I haven't been able to turn up an answer. I am adding game objects to a table in Lua like this: local lock = GameObject { -- object values and methods table.insert(objects, lock) But despite a…
2
votes
2 answers

Lua adding package.path to require doesn't work

Here is my folder structure: src/config/objects/bird.lua src/objects/Bird.lua In Bird.lua, I tried to import src/config/objects/bird.lua by using: package.path = package.path .. ';../config/objects/?.lua' local BIRD = require("bird") But it…
tung2389
  • 131
  • 1
  • 12
2
votes
1 answer

Get all variables in Lua for debug purpose with getinfo / getlocal / getupvalue

I managed to get almost all variables from my Lua application with this function, but not the ones that are local to a .lua files... Example at the root of the main.lua : local test = 10 This cannot be found. Any idea? Note: I'm running this in a…
2
votes
1 answer

Crash on nil value - Love2D Lua

I'm instantiating a ball and it works well, when I try to call centerCoordinatesOn it crashes. Ball = Class{} function Ball:init(skin) -- simple positional and dimensional variables self.width = 8 self.height = 8 -- these…
vale
  • 1,376
  • 11
  • 25
2
votes
1 answer

Why doesn't love2d use my custom-defined pairs metamethod?

I have the following code in the file main.lua: local table = {data={a=1,b=2,c=3}} setmetatable(table, table) function table:__pairs() return pairs(self.data) end function table:__tostring() return "a table" end print(table) for e in…
Josie Thompson
  • 5,608
  • 1
  • 13
  • 24
2
votes
2 answers

Calling (importing) other .lua files outside main.lua in Love2D

So, I wanted to clean up my code by splitting it into seperate files. But for some reason I can't call the script I want to call through my main.lua. Here's my main.lua script: function love.load() require "splash.lua" …
Koto
  • 430
  • 4
  • 19
2
votes
1 answer

DLL not found on certain machine with luajit FFI

I have built Game Music Emu from source to use with Love2d. (Note: I am not very familiar with C/C++.) In lua I load the dll with FFI and on my computer it works great, but when I sent my friend the app for testing, his machine doesn't recognize the…
cyman
  • 70
  • 6
2
votes
2 answers

lua -> how to modify these arguments to be const, or what should I do?

all! I came here because I have one problem bugging me for quite some time now. I am using love2d engine as a 'graphical' addition to lua scripting, but this problem is of lua type (I believe, at least). I have a function: createNew_keepOld =…
Amaterastis
  • 477
  • 3
  • 12
2
votes
0 answers

Lua Love2d Quadtree recursion

UPDATE -- I figured it out. Turns out I am bad at math and visualizing 2d points. I wasn't setting south or east subdivisions correctly. I have been trying to make a quadtree to track points in Love2d. I have the most of the code written, but I…
2
votes
1 answer

love2d connecting line segment objects to make a pencil tool that draws lines

I'm trying to create a game that is similar to line rider. I've kind of programmed a pencil right now except that the lines are scattered objects. I want to be able to connect those red dots to make a smooth line so that the ball can roll across…
Sam
  • 1,765
  • 11
  • 82
  • 176