Questions tagged [love2d]
LÖVE is a framework for making 2D games using Lua programming language.
75 questions
1
vote
0
answers
70
views
How to move objects in a wavy pattern in a specific or given direction?
I'm making a bullet hell and I want to handle a variety of movement types for my bullets (waves, flying in circles, spirals, etc). I'm currently using the following to handle linear movement at a ...
0
votes
1
answer
204
views
How to express parabolic motion using delta time?
I'm trying to figure out how to express parabolic motion (for example: \$y = x^2\$) using delta time. I thought about deriving it using a differential like \$y' = \frac{1}{2}x\$ but that results in a ...
0
votes
1
answer
230
views
What does the phrase "Kinematic bodies do not collide with other kinematic or static bodies" mean?
What does the phrase "Kinematic bodies do not react to forces and only collide with dynamic bodies" mean?
Related: I'm always confused by game engine physics explanations
I found this ...
0
votes
3
answers
353
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:
...
0
votes
1
answer
182
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/...
0
votes
0
answers
199
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 ...
0
votes
2
answers
372
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,...
-1
votes
1
answer
155
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 ...
2
votes
1
answer
220
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'...
0
votes
1
answer
79
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:
...
0
votes
1
answer
880
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 ...
3
votes
1
answer
4k
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 ...
2
votes
1
answer
205
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.
...
1
vote
2
answers
242
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
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.
...
1
vote
1
answer
171
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
1
answer
609
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
1
answer
793
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
1
answer
630
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 ...
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 ...
1
vote
0
answers
528
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
1
answer
348
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
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 ...
0
votes
1
answer
801
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
0
answers
466
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
1
answer
1k
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
1
answer
1k
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
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:
...
2
votes
2
answers
765
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
1
answer
202
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
1
answer
279
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
2
answers
2k
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
1
answer
305
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
2
answers
215
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
1
answer
577
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
function ...
0
votes
1
answer
168
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
2
answers
571
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
2
answers
303
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....
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:
...
2
votes
2
answers
441
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
1
answer
3k
views
load all files out of folder as resources in lua and love2d [closed]
If i use this code
...
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 ...
1
vote
1
answer
416
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
1
answer
981
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
1
answer
149
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
3
answers
224
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
1
answer
696
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
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.
1
vote
1
answer
735
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
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 ...