Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [love2d]

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

1
vote
0answers
32 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?
0
votes
0answers
52 views

Different textures on the single terrain mesh

I am using Love2D and want to create tiled terrain with a single mesh (to reduce the number of draw calls). I want to change a position of some tiles at runtime and do not want any gap to appear, i. e....
0
votes
0answers
45 views

How to create an instance of class with the hump library for Löve?

I followed that tutorial that explain (among other things) how to use the hump libary for Löve. At the end of the tutorial, I wanted to add the possibility for the player character to shot bullets. ...
0
votes
1answer
524 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. ...
1
vote
0answers
43 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 ...
6
votes
1answer
420 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 ...
0
votes
1answer
154 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 (...
0
votes
1answer
135 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 ...
0
votes
1answer
128 views

(love2d)How would I go about drawing the same image multiple times?

Obviously I could just copy and paste a love.image.draw() function multiple times for how many times I want the item to be drawn, but lets say I wanted to draw an ...
0
votes
1answer
294 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 ...
1
vote
0answers
162 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, ...
1
vote
1answer
139 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 ...
5
votes
2answers
978 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 ...
0
votes
1answer
364 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 ...
1
vote
0answers
186 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/...
1
vote
1answer
385 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 ...
0
votes
1answer
246 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 ...
1
vote
2answers
648 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: ...
1
vote
2answers
277 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 ...
0
votes
1answer
130 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): ...
0
votes
1answer
137 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 ...
0
votes
2answers
510 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 ...
1
vote
1answer
136 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?
0
votes
2answers
69 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 ...
0
votes
1answer
369 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 ...
0
votes
1answer
102 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 ...
2
votes
2answers
310 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 ...
1
vote
2answers
207 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....
9
votes
1answer
865 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: ...
2
votes
2answers
190 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 ...
0
votes
1answer
2k views

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

If i use this code ...
0
votes
3answers
804 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 ...
1
vote
1answer
228 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 ...
1
vote
1answer
615 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 ...
1
vote
1answer
79 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 ...
2
votes
3answers
151 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 ...
0
votes
1answer
441 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 ...
1
vote
1answer
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.
1
vote
1answer
562 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 ...
2
votes
1answer
626 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 ...
3
votes
1answer
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 ...
1
vote
2answers
792 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 ...
2
votes
1answer
4k 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 ...
0
votes
0answers
48 views

Checking if two lines are crossing [duplicate]

How can I check if two lines (created with function love.graphics.line) are crossing themselves? I may use this ability to create procedural maps via graphs.
2
votes
3answers
932 views

How can I get the force of a collision in Love2D?

Is it possible to get the force of a collision between two objects in Love2D/Box2D? If so, how?
0
votes
1answer
498 views

How to spawn an object on collision in box2d + love2d?

I'm trying spawn collidable debris from a ship when it explodes in love2d/box2d, however, World:isLocked() is true when collision callbacks are called: This will return true inside the callbacks ...
3
votes
1answer
1k views

Make some black pixels transparent in Love2D

Is it possible to put a black opaque rectangle over my game screen and then change transparency on some pixels? For example I have black rectangle on screen represented by 1 ...
1
vote
1answer
742 views

Starter love2d physics program not working

I am starting out with my first love2d (using LöVE 0.8) physics program. I am just creating some ground/floor, a car body and attaching two wheels with revolute joints and setting the motors a-go. ...
1
vote
1answer
1k views

Love2D : How can I keep up with lots of small sprites' collision data?

So I'm using a SpriteBatch to keep up with lots of small pieces for a falling-piece puzzle game. I have an array of Quads (for ...
0
votes
1answer
1k views

Love2D : Problem rotating image in a SpriteBatch

I'm working on a falling blocks type of game with triangular pieces. I'm using a SpriteBatch to accumulate and remember the pieces and their locations. The problem ...