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

How to define a class within a library in Lua (Love2D)?

I've tried defining my class on a file called "basic.lua" called "Point" and tried to implement it on the file "main.lua" but I keep getting this error: Error Syntax error: basic.lua:3: '(' expected near 'Point' Traceback [C]: at…
EpicJoeR
  • 33
  • 3
3
votes
1 answer

Two instances of a Lua "Class" are the same "object"

I am working with Love2d and Lua, take a look to my custom Lua "class": -- Tile.lua local Tile = { img = nil, tileType = 0, x = 0, y = 0 } function Tile:new (img, tileType, x, y) o = {} setmetatable(o, self) self.__index = self …
Cristofer Fuentes
  • 411
  • 1
  • 6
  • 16
3
votes
1 answer

Issue using "require()" in Lua, need help understanding why it won't work

I'm learning to use Lua, more specifically - the love2d libraries, and decided to try and organize my project by utilizing lua's 'require()' function. I know about package.path and the way it is used, but even after seemingly doing everything…
Hexanix
  • 67
  • 1
  • 6
3
votes
2 answers

Love2d: How to retain window content?

In love2d, the contents of the screen are reset between the draw calls. So that I cannot add something to the screen created during the last draw operation, for example, print another line below the line printed during the previous iteration. How…
saga
  • 1,933
  • 2
  • 17
  • 44
3
votes
2 answers

Separating Axis Theorem function fails when met with acute angles

This is a little library I was making for the LOVE2D engine in Lua, which uses separating axis theorem to solve collisions. I was so happy when I got my SAT program to work, and started testing it with a multitude of polygons. It works in most…
3
votes
1 answer

Clipping a polygon to only draw within a circle in Love2D

I'm trying to draw a circle with filled, randomly generated polygons drawn on top of it, but I can't work out how to make it so that the polygons are only drawn on top of the circle. Here's a mockup as an example: I have a achieved the random…
user3482098
3
votes
1 answer

Console isn't showing up when running print() using LOVE2d with atom-editor

Using atom-editor 1.13 with the love-ide package installed to run LOVE2d 10.2 games (windows 7) Apparently if you create a conf.lua file in the same folder as your main.lua file you can add some configuations to main.lua. So, I've got these lines of…
3
votes
1 answer

Restrict drawing to an area

The problem I would like to have an area inside love2d in which movable objects are drawn. The movement of the objects is not restricted by the area boundries but drawing is. Think of it as looking outside through a window. For example: a blue…
Siemkowski
  • 1,351
  • 5
  • 15
  • 32
3
votes
1 answer

attempt to call method 'func' (a nil value)

No matter how I approach Lua, I run into this error all the time, so I must not understand something inherit to the language: attempt to call method 'func' (a nil value) I've seen the error here a few times as well but the problem doesn't seem…
liam
  • 33
  • 1
  • 7
3
votes
2 answers

Love2D Background Image taking color from other objects

I had a question about how my love2d background image. It has been taking the color from different objects and tinting it. The background is supposed to be green and blue, but it is taking the color of the purple rectangle and tinting it purple. I…
3
votes
1 answer

lua decimals break around -0.1 to 0.1 (exclusive)

I have a Lua for loop that iterates through numbers from -1 to 1 by increments of 0.01, and is producing numbers as bad as 6.6613381477509e-016 in the range of -0.1 to 0.1 (exclusive) I am using Lua in the LOVE engine (v 0.9.2), written in C++ I…
Pixel
  • 35
  • 3
3
votes
1 answer

How third-party libraries in Lua usually handled

How third-party libraries in Lua usually handled? For example, I want to use the HUMP library for my LÖVE application. What should I do then? Is there any popular package manager? Or should I just place libraries under "vendor" / "libs" directory in…
FrozenHeart
  • 19,844
  • 33
  • 126
  • 242
3
votes
3 answers

Background colour in LÖVE

I've set up a config file and I just got started writing a program to set up the title screen for a text-based RPG/simulation game. The background colour doesn't seem to be changing from the default black, which is the issue. I've posted my existing…
Magikarp
  • 171
  • 1
  • 11
3
votes
1 answer

Coding with love.graphics.draw arguments. Get the exception " bad argument #1 to 'draw'(Drawable expected, got nil)"

recently I have been trying to learn how to code games and I'm using lua 5.1 as the language and love2d as the engine. I'm not familiar with either and I'm still trying to learn how to use them so all of this is example code based off of Goature's…
Jacques
  • 75
  • 10
3
votes
1 answer

How to get "sizeof" a table in Lua?

I'm dabbling in Love2D using Lua and have just implemented a StateMachine to handle transitions between a set of states e.g. IntroState, MenuState, PlayState etc.. In previous programs I usally release objects and/or states that are only a…
SvinSimpe
  • 850
  • 1
  • 12
  • 28
1 2
3
43 44