Skip to main content

Questions tagged [love2d]

LÖVE is a framework for making 2D games using Lua programming language.

Filter by
Sorted by
Tagged with
0 votes
3 answers
99 views

Implementing framerate independent friction with linear deceleration

I'm implementing friction into my game, and I'd like it to be framerate-independent. Here's my first solution, in Lua style pseudo-code: ...
Yolwoocle's user avatar
0 votes
1 answer
126 views

Why check the ball and brick collision twice?

I watched https://www.youtube.com/watch?v=F86edI_EF3s. I believe the following code is the complete code https://github.com/games50/breakout/tree/master/breakout13 And https://github.com/games50/...
shingo.nakanishi's user avatar
0 votes
0 answers
113 views

What's the most basic way to create and handle multiple objects?

I'm trying to figure out what the most basic approach would be to effectively (or at least more effectively than what I have) create and manage objects. I know I could store them in a table when I ...
Konjointed's user avatar
0 votes
2 answers
249 views

Numbering sprites in a sprite sheet left-to-right, top-to-bottom

I'm using this program called Quadtastic which is a sprite sheet management tool that lets you define quads on a sprite sheet, name them, etc, and export to metadata with those names (+ position, size,...
Garflington's user avatar
  • 1,055
-1 votes
1 answer
112 views

Are there any practical applications for clearing the screen with a specific color?

Why is it common in the 2D game frameworks for the clear function to have the option of clearing the entire screen with a color? Why is this option available to us? Are there any practical ...
Đạt Phạm's user avatar
2 votes
1 answer
146 views

How to deal with rapid acceleration/deceleration from physics forces?

I'm working on a game in LOVE2D using Lua, where you pilot a drilling vehicle. The idea is that as you drill into different surfaces, you speed up/slow down depending on how dense that surface is. I'...
Adam L.'s user avatar
  • 41
0 votes
1 answer
41 views

Drawing rectangle with line's causes join artifact with the graphics api

how can I join lines to draw rectangles, I get this artifact like this, here's my code: ...
eguneys's user avatar
  • 247
0 votes
1 answer
782 views

Play and Pause State

Problem i want to implement a pause state and with a simple conditional inside the update of PlayState is very very simple. However i think that the pause has to be another state in the StateMachine ...
WhySoBizarreCode's user avatar
1 vote
0 answers
2k views

Optimizing falling sand simulation

So, for the past couple of weeks, I've been working on a falling sand simulation inspired by games such as The Powder Toy, Noita, and Sandspiel. I've been making it in Love2D and I'm please with what ...
Garflington's user avatar
  • 1,055
2 votes
1 answer
150 views

How to make object that moves with constant speed not overshoot the object it collides with?

To learn LOVE2D I am creating a simple project. Player moves the square with arrows keys until it hits the goal square, at which point the game is won. ...
shinkarom's user avatar
1 vote
2 answers
185 views

Is there a way to set a shader define in Löve?

I know I can use shader:send() to change variables, but is there a way to set/change a #define?
IanLarson's user avatar
  • 771
0 votes
1 answer
3k views

Create a game start-up menu screen with Lua/love 2d

I just got started programming games and decided to try out love2d since I'm learning lua. I was wondering if anyone knows how I can create just a simple 2-3 button menu when you start up the game. ...
bouracine's user avatar
1 vote
1 answer
122 views

How can I properly render multiple layers/components in game?

I'm making a Love2D board game video game, which has multiple different components which need to be run and displayed on the screen at the same time. For example, I need to display the board, the ...
132ikl's user avatar
  • 11
6 votes
1 answer
564 views

Love2D game and editor in two separate programs

I'm building an engine in Love2D and I need to build an editor who will create scenes with game objects I wrote in lua. The thing is that there's this guy in my team who said : "Don't include the ...
Antoine Thiry's user avatar
0 votes
1 answer
722 views

Love2D STI library not drawing map at all (black screen)

I'm trying to use a pretty standard map with the Simple Tiled Implementation module for Love2D, but no matter what I try, I can't get it to display anything but a black screen. Here's my current code (...
Alexis Purslane's user avatar
0 votes
1 answer
532 views

Love2D how to zoom out map?

I've set up a basic map with Tiled, imported it with STI library (https://github.com/karai17/Simple-Tiled-Implementation) and everything looks in place. How can i get a zoom-out feature now? I can ...
brazorf's user avatar
  • 111
1 vote
1 answer
1k views

Change transparency of image at runtime, LOVE2D

I would like to know how to take a defined image (e.g. a tile) in the LOVE game engine and draw it with a transparency that may vary per-frame. Stencils seem to only work for completely hiding parts ...
Vivian's user avatar
  • 123
1 vote
0 answers
455 views

Sprite batching and dealing with isometric depth sorting

So I'm using Love2D which uses SDL2* as far as I'm aware and I have a question about texture atlases & spritebatching. I have an isometric chunk, with 2 layers, terrain and objects (trees, ...
KayleMaster's user avatar
1 vote
1 answer
284 views

Löve2d: How can i select object with mouse if it's overlap?

I have already some code but i can't solved this. How can i select one object with mouse if the objects are overlap? It's looks like solitaire game. I wish you can understand me... For example my ...
012rev3's user avatar
  • 11
5 votes
2 answers
2k views

What's wrong with using physics engine in 2d platformer?

I started making my simple 2D runner game with a splash of physics (particularly, rope physics). It's in Love2d, project is targeting mobile platforms. Development goes fine, though I meant to ask one ...
metamorphling's user avatar
0 votes
1 answer
729 views

Love2D and 'Tiled' - Detect if player is over certain tile/Collision

I created a 50x50 tile map with 32x32 tiles in Tiled and exported it as a Lua file so I can use it in Love2D. I have a player you can move around the world but I'm attempting to convert the player's x ...
freemann098's user avatar
1 vote
0 answers
433 views

Reimplemented steering seek behavior from PyGame to LÖVE is much slower than original

I'm learning about steering behaviors and watched this nice explanation tutorial - https://www.youtube.com/watch?v=g1jo_qsO5c4&feature=youtu.be with the source code available at https://github.com/...
Kosmetika's user avatar
  • 121
1 vote
1 answer
902 views

How to create a transparent mask in Love2D

Since Love2D doesn't support SVG, I'm looking for other ways to create solid, compound shapes. Anything that has straight edges can be drawn using a polygon, but I haven't yet found a way to mask an ...
undefined's user avatar
  • 130
0 votes
1 answer
925 views

How do I represent blended tiles in a mesh/vertex array?

I recently started making a Terraria clone using the LÖVE library, which is based in OpenGL. In Terraria, for each tile, there is a large texture with all possible combinations for merging with ...
Franz Wexler's user avatar
1 vote
2 answers
1k views

.PNG changes color in Love2D

I have a small .PNG file. I load it with: picSmiley = love.graphics.newImage("salamander.png"); and I draw it with: ...
ZirconCode's user avatar
2 votes
2 answers
677 views

Calculate 8 different directional input based on arrow keys combinations

Considering I have four variables event binded to each arrow key, that can be 0 or ...
Mojimi's user avatar
  • 121
0 votes
1 answer
172 views

Got unexpected results from perlin noise. Wondering what it is doing?

I was just messing around with perlin noise and got this. Wondering if anyone knows what it is or has seen it before. Here is the code(LUA with love2d engine): ...
digitalsoldier0's user avatar
0 votes
1 answer
221 views

Unwanted line between chunks in heightmap infinite terrain

I can't figure out what is causing the line between my two chunks. They are completely aligned. It must be something to do with the algorithm. I am using lua with the love2d game engine. Here is a ...
digitalsoldier0's user avatar
0 votes
2 answers
1k views

My perlin noise height map doesn't have smooth transitions and goes directly from black to white

I am using lua with the love2d engine to make infinite 2d tiled terrain with perlin noise. This is just the first step and I want to fix the bugs early. The problem is that there is no gradient ...
digitalsoldier0's user avatar
1 vote
1 answer
244 views

Can i put the main Love2D functions inside a table?

Instead of having a file with load, update,and draw can i say have a table called player, then put love.update and love.draw in that table to handle the drawing and updating of that particular player?
Marcus Little's user avatar
0 votes
2 answers
146 views

What does this shader error in Löve2D mean?

What could I've done wrong to get the following error message when trying to create a GLSL shader in Löve2D? I'm sincerely clueless of what the mistake could be, though I suspect the error being a ...
user6245072's user avatar
0 votes
1 answer
546 views

Love2D: Calling two files

Okay so i have two files one named Player.lua and one named Main.lua Main: function love.load() end function love.update() end function love.draw() end Player: function player.load() end ...
Ras. M's user avatar
  • 3
0 votes
1 answer
142 views

How do I select a portion of the window using Love2d

I want to be able to divide the window of the game in, lets say, 3 places, and when the mouse (or touch) click one of those places, execute some code. Do I have to make each portion a button-like ...
Kudefe's user avatar
  • 17
2 votes
2 answers
526 views

How do I handle objects with a width and height in grid-based pathfinding?

I'm using the Jumper library for Love2D to do grid-based pathfinding, which worked fine until I wanted to make larger enemies (with larger collision boxes). How do i do that? My initial idea was to ...
Julian's user avatar
  • 133
1 vote
2 answers
268 views

HardonCollider Error: attempt to call method 'addRectangle' (a nil value)

I want to add collision detection mechanism to my game, which is written in love2d. As i do not want to implement my own algorithm, i have found a HardonCollider library to do the heavy lifting for me....
Alexander's user avatar
  • 131
10 votes
1 answer
2k views

In a 2D physics engine, how do I avoid useless collision resolutions when objects come to a rest?

In a physics engine I'm developing (for learning) using love-2d, I implemented collision resolutions in this way: ...
dnk drone.vs.drones's user avatar
2 votes
2 answers
382 views

Is my Lua form/scene loading setup efficient?

At the moment, I'm working on a small game project using LUA and the love2d framework. Using this framework, I've made my own assets (i.e. button images, form images, etc), and using these assets I've ...
Bilfred's user avatar
  • 123
0 votes
1 answer
3k views

load all files out of folder as resources in lua and love2d [closed]

If i use this code ...
frosty's user avatar
  • 111
0 votes
3 answers
2k views

Löve2D: Making a random map/city generator [closed]

So I'm making a game using love2d where the player will find himself in an zombie infested city but I don't want the city/map to be just the same all the time, so I want to create a random map/city ...
Louie's user avatar
  • 117
1 vote
1 answer
372 views

LOVE Physics - Joint Stretching

After asking a similar question yesterday I've come across another problem with using joints in box2D / LOVE and trying to create a weighted chain. Everything is set up as follows, I've tried to ...
user3510227's user avatar
1 vote
1 answer
879 views

LOVE Physics - Breaking Joint Chains (LUA / Box2D)

Wasn't sure whether to post here or on SO so please move if needed. I've been having a look into the box2D physics API provided by LOVE to try and create a swinging flail or weighted rope but I'm ...
user3510227's user avatar
1 vote
1 answer
128 views

Nested ipairs for basic hit detection

I'm developing my first game using Löve, the game is a basic Asteroids clone. Everything is going well so far, until I decided to actually add asteroids. I'm trying to make a basic hit-detection that ...
Smgweat's user avatar
  • 13
2 votes
3 answers
167 views

Building a C-E engine in a high level language, how can I integrate optional lower-level components that own overlapping state?

To clarify, by overlapping I do not mean overlapping between said components, but rather, let's say I have: My entity contains components, and a parent-children system. Call it a mandatory ...
Llamageddon's user avatar
0 votes
1 answer
641 views

2D physics collision/gravity problem?

I'm using Love2D and my own physics engine to create a 2D platformer. Y collision works fine, but X collision... well, it's a bit buggy. When I move off of a small platform I've created, I fall but it ...
Blahgory's user avatar
1 vote
1 answer
5k views

Run Love2D on iphone and android

I have a game developed in lua using love 2d, and now i want to run it in ios/android. Is there any porting or way available to do that. Thanks.
user654987's user avatar
1 vote
1 answer
674 views

Love2d: Failed to load tileset map

I'm reading the Love2D Development book, which i think i will stop reading because is outdated and very instable, sometimes i got a lot of troubles. Backing to the question, i made a tileset map with ...
RebeloX's user avatar
  • 113
2 votes
1 answer
1k views

Love2D Box2D RevoluteJoint and Anchors

and apologies in advance for this fairly random question. I'm using Love2D 0.9.1 and Box2D to create two bodies joined by a revolute joint. A simplified representation of the two bodies is a Sphere ...
Danhoo's user avatar
  • 23
3 votes
1 answer
1k views

Make an object follow the mouse pointer with LÖVE2D

I've been trying to make a picture follow the mouse pointer with LÖVE2D. I want that the object follow the mouse, and not just be the mouse coordinates, I did that. So I toked the distance between ...
ranu's user avatar
  • 131
1 vote
2 answers
960 views

Smooth moving on tile-based map, how to fix simple collisions?

I've already had some experiences about the work of 2 dimensional square-based playfields and moving a player on them. Though, when a square has multiple pixel sizes, and player moves e.g. 1 pixel per ...
Zoltán Schmidt's user avatar
2 votes
1 answer
6k views

Generating transformation matrix for 2D camera with pan/zoom/rotate

Question How do you implement a camera with pan/zoom/rotation for a 2d game? Is it acceptable to multiply together a series of transformation matrixes to generate a final transformation matrix that ...
Johannes's user avatar
  • 130