Search found 512 matches

by MrFariator
Fri Nov 03, 2023 3:27 am
Forum: Support and Development
Topic: How to reference Bump's "bounce variable
Replies: 5
Views: 1799

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: 2883

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: 8913

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: 2964

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: 7324

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: 6270

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: 926

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: 926

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: 348

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...
by MrFariator
Sat Aug 26, 2023 2:25 pm
Forum: Support and Development
Topic: Having trouble with bump when different objects are on the screen
Replies: 2
Views: 526

Re: Having trouble with bump when different objects are on the screen

You are experiencing this behavior because you are using the world:check function, as opposed to the world:move function. -- change this... local actualX, actualY, cols, len = world:check(player, futureX, futureY) -- to this local actualX, actualY, cols, len = world:move(player, futureX, futureY) As...