Search found 513 matches

by MrFariator
Fri Nov 03, 2023 11:08 pm
Forum: Support and Development
Topic: How to reference Bump's "bounce variable
Replies: 5
Views: 1813

Re: How to reference Bump's "bounce variable

Going to need to see more code to properly inspect what the issue could be. Can you provide a minimal working example? At the very least, going to need to see what your collision filter is ("bounce" in your code), and how you have defined your entities (the contents of "listofBad"...
by MrFariator
Fri Nov 03, 2023 3:27 am
Forum: Support and Development
Topic: How to reference Bump's "bounce variable
Replies: 5
Views: 1813

Re: How to reference Bump's "bounce variable

When you are looping through the collisions, you're accidentally using the wrong variable to access the list of collisions: for i = 1, len do if cols[v].bounce.x > v.x then -- the '[v]' should be '[i]' -- ... end end In addition, it might be wise to first check that the collision response is a bounc...
by MrFariator
Sun Oct 29, 2023 3:26 am
Forum: Support and Development
Topic: Fixed screen in Menori
Replies: 1
Views: 2888

Re: Fixed screen in Menori

I'm not familiar with Menori, but I presume you can render its output (and any other things you need) onto a canvas. You can then figure out the biggest rectangle that respects the desired aspect ratio, and then render the canvas to the screen with those dimensions.
by MrFariator
Wed Oct 25, 2023 10:41 pm
Forum: Support and Development
Topic: Copying a file from a local directory to the LOVE save directory
Replies: 2
Views: 8956

Re: Copying a file from a local directory to the LOVE save directory

You could potentially use os.execute, and run some copy commands to transfer those files over. These commands may be platform specifc, like using robocopy on windows. This method may flash a command prompt on users' screens, but if you mean to do the file transfers as a one-time thing (eg. when firs...
by MrFariator
Fri Oct 20, 2023 12:18 am
Forum: Support and Development
Topic: How do I make a value absolute?
Replies: 5
Views: 2998

Re: How do I make a value absolute?

If you mean to take the absolute value of a number, the function you're looking for is math.abs:

Code: Select all

local value = -2
value = math.abs(value)
print(value) -- prints 2
However, if you mean something like a constant value, ie. a value that can not be changed, that's a bit more complicated topic.
by MrFariator
Sun Oct 08, 2023 4:01 pm
Forum: Support and Development
Topic: I have a question about how lua works in general
Replies: 8
Views: 7353

Re: I have a question about how lua works in general

Well, as the error warns you, you can not index a function. To illustrate it, consider this minimum example: local function myFunction() end -- an empty function that does nothing myFunction() -- ok myFunction.someValue() -- error, can not index a function The same goes for situations, like trying t...
by MrFariator
Sat Sep 23, 2023 2:21 am
Forum: General
Topic: I just accidentally found a literal zip bomb for the ram in love
Replies: 3
Views: 6339

Re: I just accidentally found a literal zip bomb for the ram in love

While it's surprising that your example creates so much garbage, it's not also not particularly special, now is it? There are many ways to fill up RAM (excessive table creation, loading a bunch of assets into memory), force heavy CPU loads (just modifying love.run slightly could do), or cause excess...
by MrFariator
Tue Sep 19, 2023 12:09 am
Forum: Support and Development
Topic: Need help understanding bump.lua and also why my bullets act this way
Replies: 3
Views: 933

Re: Need help understanding bump.lua and also why my bullets act this way

Right, I think I intended to do that modification as well (either doing what you did, or assigning to a local variable), but must've slipped my mind.
by MrFariator
Mon Sep 18, 2023 6:54 pm
Forum: Support and Development
Topic: Need help understanding bump.lua and also why my bullets act this way
Replies: 3
Views: 933

Re: Need help understanding bump.lua and also why my bullets act this way

I believe the issue stems from the following: for i, bulletToRemove in ipairs(bulletsToRemove) do world:remove(bulletToRemove) table.remove(activeBullets, bulletToRemove[i]) -- this line here end I'm reasonably sure bulletToRemove[ i ] will just evaluate to nil in this context, which means that tabl...
by MrFariator
Thu Sep 14, 2023 3:59 pm
Forum: Support and Development
Topic: REQUESTING HELP
Replies: 1
Views: 352

Re: REQUESTING HELP

Welcome to the forums. The issue is here: for i = 0, totalStars, 1 do stars [1] = { -- the "1" here is the problem r = love.math.random(0,255) / 255, g = love.math.random(0,255) / 255, b = love.math.random(0,255) / 255, a = love.math.random(0,255) / 255, x = love.math.random(0, love.graphi...