685 questions
0
votes
0
answers
81
views
Error loading lsqlite3 module for love2D due to "symbol not being found"
Follow-up to this question
My current project folder includes the main.lua file, a .db file, , a sqlite.lua file from this somewhat old page, and a lsqlite3.so file copied from my homebrew folder. ...
1
vote
0
answers
94
views
how to avoid error loading lsqlite3 module for Love2D?
Important edit: it think that the issue might come from the fact that I'm using a Mac that uses an Arm64 processor. However, I'm not entirely sure since I don't know what that means.
I'm trying to use ...
3
votes
3
answers
152
views
Declaring a variable as 'local' when outside Lua functions
I understand the difference between the scope of local and global variables, but I am confused about the difference and effects of declaring a variable OUTSIDE of Lua functions (or LOVE2D core ...
4
votes
2
answers
138
views
Issue when executing a function from a class
I'm running into some confusion in trying to make a button that executes a function from another class I have.
Firstly, i have a "button" class that i made, in which one of the parameters is ...
0
votes
0
answers
79
views
Is there a way to synchronize love.system.setClipboardText() with browser's clipboard
So I just hosted my first game in web using love.js but the text area where one can paste or copy from only works if the in game text is copied, meaning I cannot paste text copied text from another ...
3
votes
1
answer
101
views
Love2d flickering edge on player movement
I created a simple code using Love2d that display a map created with Tiled (pixel art style), and draw a square as a player who can freely move across the map. However there is some jitter or ...
4
votes
1
answer
124
views
player movement not working when moving in a specific direction (Lua/Love2d)
I'm making a project in Love2d and, on top of a simple movement system, I tried to implement something where the player will "teleport" in the direction they are moving when the "e"...
0
votes
1
answer
90
views
Issue with displaying the layers of an isometric tileMap on love2d
I'm actually developping a simple serious game and wanted to do it with isometric tilemaps on love2d but i couldn't find a way to handle its different layers (this is my first time with ua and love2d),...
0
votes
1
answer
119
views
Loop exceeds its limit
I am experiencing a very strange error in Lua/Love2D code where for-loop index exceeds the maximum limit. The initial problem arose from Geom.segmentSegmentIntersection() having passed nil as argument ...
1
vote
1
answer
103
views
Layers display and movement in Love2D (Lua)
I'm currently working on a small 2D game using the LÖVE2D engine. I created a background with Tiled and exported it as a .lua file. However, I'm facing two issues with this background:
Problem number ...
2
votes
1
answer
182
views
Lua Love: Mapping from isometric screen coordinates to game coordinates results in "off by one" x-coord
Source code used here: https://github.com/omrilevia/lua-iso
I've been playing around mapping screen coordinates to isometric coordinates and vice versa, following this tutorial: https://pikuma.com/...
1
vote
1
answer
72
views
Polyline Curvature Combs in Lua, Love2D
I have a polyline (white) with coordinates {x1, y1, x2, y2, x3, y3 ...}
polyline = {100,300,160,257,220,242,280,250,340,271,400,300,460,329,520,350,580,358,640,343,700,300}
How can I get the ...
1
vote
1
answer
79
views
Why is my OSM map rendering squished in Love2D?
Why is my OSM map rendering squished in Love2D?
I'm trying to render an OpenStreetMap (.osm) file in Love2D without using external libraries. The issue is that the displayed map appears vertically ...
2
votes
1
answer
256
views
How do I make a font with an image in LOVE2d
I am using the LOVE2d framework, and I am not sure how to use the newImageFont() function.
I checked the online documentation, but it wasn't very clear on what variable did what. Also, some letters ...
1
vote
1
answer
66
views
Using love2d timer, bug reporting 'Error hump/timer.lua:78: attempt to index local 'self' (a number value) '
below is where the error may occur
Here is my main.lua and I note the place where I think the error is. What I can't figure out is why this sentence will return a number value?
I'm learning Downwell's ...
0
votes
0
answers
116
views
How can I correctly distribute cars across slots based on probabilistic assignment in Lua?
I'm working on a simulation in Lua where I need to randomly assign cars to a set of slots based on probabilities. Specifically, I want the probability for each slot to be adjusted dynamically as the ...
2
votes
1
answer
265
views
screen resolution always overridden
I'm trying to learn love2d and I am having an issue with fullscreen. no matter how I try to set the resolution, it always ends up setting itself to 1536x864. My native resolution is 1920x1080, and I ...
1
vote
1
answer
51
views
beginCollision callback not allowing two fixtures
Here's where I set the callbacks:
GameWorld = love.physics.newWorld(0, 0, true)
GameWorld:setCallbacks(self.contact)
Here's the contact method:
function thisScene:contact(a, b, coll)
print(a, b, ...
1
vote
1
answer
243
views
How to get VSCode's Love2D Support extension to recognize my path?
I installed Love2D and the Love2D Support extension for VS Code. I can run Love2D from the command line ($ love). In addition, $ which love provides the app's path (usr/bin/love). Typing $ usr/bin/...
1
vote
0
answers
65
views
Angle to Normalized Vector seems to only be returning in 45 degree increments
Im making a Raycaster style engine in Love2D, I'm using this function
function AngToVec(angle)
local one = math.cos(math.rad(angle))
local two = math.sin(math.rad(angle))
local vec = { two,...
1
vote
1
answer
105
views
Love 2d - match 3, I get a stack overflow
main.lua:147: stack overflow
Traceback
[love "callbacks.lua"]:228: in function 'handler'
main.lua:94: in function 'matches'
main.lua:80: in function 'checkforNil'
main.lua:89: in function '...
0
votes
2
answers
107
views
Lua Love2D, CS50's Introduction to Game Development, knife library Timer.tween syntax
I'm working through the CS50 intro to game dev course and I'm having a syntax error I've been beating my head against.
I'm trying to write a function using the knife timer library that will be called ...
0
votes
2
answers
2k
views
undefined global lov2d not working in vs code
so i downloaded love2d and its in program files and added it to the environment variables and opened vs code and downloaded the extension of love2d support and i did everything like the video on ...
0
votes
0
answers
109
views
error ''undefigned symbol: lua_rawgetp'' while trying to bind a love project with rust
I have a love2d project where I am trying to bind midi controllers with rust and mlua rust library,
I have this file configuration :
.
├── conf.lua
├── data/
├── fonts/
├── icon.png
├── images/
├── ...
1
vote
1
answer
46
views
Comparing multiple values in a table makes it that it choses to compare only one randomly
I am making a tetris clone in love2d (lua) for practice. And what I am trying to do is to make the collins with the walls.
Note:the tetris pieces are made out of tiles that each one has a relative ...
1
vote
0
answers
99
views
setuserdata and getuserdata in lua
I'm trying to run code that spawn 2 squares affected by gravity. When they hit each other, they just get destroyed using setuserdata and getuserdata. When I try to getuserdata, I get a nil value. What ...
1
vote
0
answers
67
views
Why is the x value in my lua table changing after being created by a for loop?
I am trying to make a chess game in love2D, and I am presently trying to generate 8 black pawns in the 7th row, but they all end up in at the last spot of the row.
A picture of (seemingly) 1 pawn in ...
0
votes
1
answer
334
views
How to get the position of a moving object once? without it being updated
I have an object moving "freely" with body:applyForce( x, y ).
I want to track it's previous position.
I set a timer and with every second that goes by i get the position of the moving ...
1
vote
1
answer
636
views
Love2D does not run in VSC
I installed LOVE2D into the program files path, I added it to the environment variables, and I installed LOVE2D Support into Visual studio code. Why are the variable still showing up with the error &...
1
vote
1
answer
891
views
how can i fix diagonal movement being faster than normal movement? (lua/love2d)
When I move diagonally, the movement becomes faster, I know why this happens I just dont know how to fix it.
function love.update(dt)
if love.keyboard.isDown("w") then player.y = player....
2
votes
1
answer
77
views
image not loading over others in pause state
I am trying to create a pause function in my CS50G fifty-bird problem set. However, the image I have to come up is behind the pipes and bird when it is rendered. I am new to using Love2d and Lua but I ...
1
vote
1
answer
47
views
Generating tables with unique addresses
I am attempting to insert a series of tables that have values generated by a function. I have noticed that the generated tables all have the same address and thusly only the most recently generated ...
0
votes
1
answer
99
views
Can't read file in Lua after I moved the .love file elsewhere
So I zipped my Love2D project and it works when I launch it in the same folder, but elsewhere my io.open doesn't work. Here's my file system:
...
utils
|json.lua <-- library I use for encoding ...
0
votes
1
answer
102
views
Why are my billboarded quads being rendered this way?
So I am instancing a quad a bunch of times in an area in love2d, which seems to be going fine, but when I add some shader code to billboard them they render at an odd spot and look like they are all ...
0
votes
1
answer
564
views
attempt to call method 'draw_self' (a nil value) error - when trying to call function of a table within an array
I just started learning Lua and LOVE2D, I'm trying to make text input boxes, I've got 4 instances within an array and I'm trying to call their draw function within the love.draw()
TextBox = {
x = ...
0
votes
0
answers
81
views
CS50G Breakout - Paddle Size Update Glitch?
So everything in my code is fine and everything was going as expected. But then I realized 2 things, 1, my paddle doesn't go past size 3 despite having self.paddle.size = math.min(4, self.paddle.size +...
0
votes
1
answer
100
views
Löve android distribution and licence
I can't compile a minimalist Löve project in order to make an app for Android. I'm stuck at the "licence stage". In Debian 10, sdkmanager seems not to be installable separately (all sources ...
2
votes
0
answers
106
views
CS50G Lecture 2 Breakout: Powerup Not Working
I have my powerup class and I've done all the code in playstate.lua to inact the powerup once it hits the paddle by generating a new ball. The problem is in my actual game, balls spawn even before the ...
0
votes
0
answers
50
views
Collision doesn't work in love2d what to do?
The collision of river is not working, its just an if statement where i've written the coordinates of river when the frog collides with those coordinates it should change the state. When frog collides ...
0
votes
1
answer
876
views
Is there a way to package your Love2D game into a bytecode distributable?
i plan on comercially releasing games soon, so i would like to find out a way to compile to bytecode and then fuse it into an executable. I have been searching for a way for literal months, but i ...
0
votes
1
answer
275
views
lua/love2d - need to understand how pause in PlayState works in love2d breakout game
I'm asking this here because even though there is another board dealing specifically with the course this game is from, hardly anyone ever responds to questions on that board. I'm hoping that those of ...
0
votes
1
answer
142
views
How do I pass variables and tables through functions on Lua?
I'm trying to simplify my code by putting everything through functions, but I don't think that the variables and tables are passing through the arguments in my code, or nodeNumber isn't working ...
0
votes
1
answer
169
views
Why can't Linux display/run lua code on my Chromebook in terminal?
I'm desperately trying to open a game using Love2d and the following error occurs when I insert love /path/to/my/proyect/on my Chromebook terminal.
Error
boot.lua:577: Cannot load game at path '/home/...
1
vote
0
answers
103
views
Every time I try to implement gravity to a sprite in Love2d, it breaks another feature,
Im trying to give the player for a game im working on gravity when its not climbing a ladder,
but every time i try to implement this feature, something climbing ladders breaks, and when i try to fix ...
1
vote
1
answer
903
views
LOVE2d is giving me an error for a nil value, though it was working fine before I added images to my sprites
I'm working on a top-down zombie survival game, and I had everything for the prototype working, but the moment I add images, everything breaks and I get this error:
Error
main.lua:46: attempt to ...
4
votes
3
answers
340
views
Is there a way for me to avoid using a global variable here?
So I just started learning Lua and Love2D and am using global variables when I need callback functions to communicate with eachother. For example:
enter_pressed = false
function love.update(dt)
if ...
0
votes
0
answers
70
views
Circle and Player not visible despite being drawn
Player nor circle is appearing.
The player and circle are being drawn but not now showing up on the screen.
When the player presses a key the player moves that way, the player stops on the grid and ...
0
votes
1
answer
170
views
CS50 - Lua/LOVE2D - how to share the same updated random number variable between two classes (Flappy Bird)
I am doing the CS50 Intro to Game Development course, which uses Lua and LOVE2D for its games. I've discovered a bug in the assignment code, but I am unsure how to fix it.
The assignment is a Flappy ...
0
votes
2
answers
91
views
Lua & Love2D Table loading not working correctly
So basically I am trying to make a game where you can drag tiles into a spot onto the screen, but when I drag the tile and release the mouse, the last tile placed move randomly for no reason. It just ...
0
votes
0
answers
194
views
love2d sprites remove background from image
so for every character that I add a sprite, they end up like this.
I've tried with different images, all png. only one seems to work fine and not have a background square but can't figure out why. ...