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

How to change love2d code to suit corona sdk (both are in the lua language)

I created a game using the love2d framework and now I want to transfer it to the corona sdk. Unfortunately, I'm receiving an error as corona doesn't support love functions. How to correct this? Thanks! main.lua (basically the love.something…
Programmer
  • 1,266
  • 5
  • 23
  • 44
-1
votes
2 answers

Getting the players window size, change position according to the size?

Here is what I mean. On a small window: The spaceship aka the player's position is perfect, near the bottom. But if I go fullscreen: the position of the player is in the middle. How would I make it so it's always near the bottom? How would this…
fnTASY
  • 1
  • 1
-1
votes
1 answer

Lua. Attempt to index global "a" (a nil value)

I'm getting the following error: Attempt to index global "a" (a nil value) local gfx = love.graphics return{ new = function( Image, Animation, Time) return{ current_frame = 1, current_anim = 1, …
Denis Smirnov
  • 101
  • 1
  • 4
  • 16
-1
votes
2 answers

Lua: Making a collision system in a simple shooter and im having issues with removing the enemy object

I'm making a simple shooter in lua using love2d. For some reason when i launch the game the program thinks the enemy has been shot and doesn't spawn it. I think theres an issue on line 80. It seems to think enemy is nil at all times no matter what.…
-1
votes
1 answer

Creating a table inside of a function returns an error

When I insert the following code (into LÖVE's engine) function createNewBody(id,m) if world.attributes.isCreated==true then world.body[id]={mass=m,x=0,y=0,xAccel=0,yAccel=0,xR=0,yR=0} --error is in this line. …
MTadder
  • 33
  • 2
-1
votes
1 answer

End Function not Recognising - Lua

I have quite the annoying bug right now, whenever I run this code function player.detect() for j = #bullet, 1, -1 do if CheckCollision(bullet[j].x, bullet[j].y, bullet.w, bullet.h, enemy.x, enemy.y, enemy.w, enemy.h) then …
Zach Herzer
  • 31
  • 1
  • 6
-1
votes
1 answer

objects in tilemap that uses spritebatch

So I use a spritebatch for my tiles. I have a ground layer, object layer, and foreground layer. The ground layer and foreground layer use 1 (and the same) spritebatch that uses 1 tilesheet of scenery tiles. The object layer is for actors and…
user441521
  • 6,942
  • 23
  • 88
  • 160
-1
votes
1 answer

How to stop player from travelling through a layer?

I am working on a tile-based game. However, due to things such as furniture my map has multiple layers. I have (for the time being) created a square to represent my player. In order to stop my player walking on furniture, I need to make a function…
Forrest4096
  • 159
  • 1
  • 8
-1
votes
2 answers

How can I set a picture to a table value? (love2d)

I'm doing a start menu for my game in Love2d. I need buttons for my "start game" and "quit game", of course. I know how to use text for buttons, but I do not know how to use actual pictures. I'm basing myself on this tutorial. Help, please?
hexagonest
  • 612
  • 1
  • 10
  • 25
-2
votes
2 answers

Does love.keyreleased(key) function the same as love.keyboard.isDown?

Does the love.keyreleased(key) function the same as love.keyboard.isDown? For example, can I declare: function love.update() if love.keyreleased("left") then hero = heroLeft end end
Switchkick
  • 2,716
  • 6
  • 21
  • 28
-2
votes
1 answer

Table is both nil and not nil at the same time

For some reason, when I access only my main table, it's fine, but when I try to access it using a variable, it's somehow nil? Here's the function that's giving the error: function parseMtl(mtlFilePath, mtlTbl) -- Parses the mtl file at mtlFIlePath …
NickKnack
  • 119
  • 1
  • 8
-2
votes
1 answer

How can I create a textbox class in love2d that can input data to calculate?

How can I make a text box to be able to enter numbers using them to calculate in love2d ?
-2
votes
1 answer

love2D cannot figure out how to make basic collision with two circles does not give error

I am trying to make it so that when my red circle touches my white circle the red circle will move back a step when i run the code the collision I tried does not work. It just goes right through the white circle. Here is the code win =…
-2
votes
1 answer

love2d just wont accept some codes

Every time I use this: function love.draw() love.graphics.setfont(love.graphics.newfon(50)) I get this error: Error main.lua:2: attempt to call field newfon (a nil value) Traceback main.lua:2: in function draw [C]: in function xpcall How can I…
-2
votes
1 answer

How to generate tiling Perlin noise in Lua?

All I have at the moment is this mess of code: http://pastebin.com/F9Dc7pbR Which is not tileable, nor pretty (You'll have to take my word for it as I can't post it due to reputation). I also have found this example code for noise that would tile:…
Randy G
  • 3
  • 3
1 2 3
43
44