Search found 3548 matches

by pgimeno
Wed Apr 10, 2024 11:56 am
Forum: Support and Development
Topic: Weird error for a function that is correct.
Replies: 10
Views: 481

Re: Weird error for a function that is correct.

This: if x then something() else if y then something_else() end is exactly the same as this: if x then something() else if y then something_else() end In the latter case, you can clearly see how the else is not closed. That's why we have elseif . This is properly closed: if x then something() elseif...
by pgimeno
Thu Apr 04, 2024 11:01 am
Forum: Support and Development
Topic: 2D Array
Replies: 6
Views: 381

Re: 2D Array

There's also an indentation problem within FallingSand:update(). This IF statement:

Code: Select all

if input:down('leftButton') then
is closed at the very end of the function, but the indentation suggests that that's not the intention.
by pgimeno
Mon Apr 01, 2024 12:39 pm
Forum: Support and Development
Topic: How to force draw an image on top of another image?
Replies: 6
Views: 368

Re: How to force draw an image on top of another image?

You can't reliably use ipairs() in that circumstance either. You have to either loop backwards, which ipairs() doesn't do, or manually advance the index or decrease the count as appropriate, like the loop I posted does.
by pgimeno
Sun Mar 31, 2024 8:33 pm
Forum: Support and Development
Topic: How to force draw an image on top of another image?
Replies: 6
Views: 368

Re: How to force draw an image on top of another image?

[...] local function drawImages() for i, imageData in ipairs(ImagesToDraw) do [...] if imageData.y < 600 then love.graphics.draw(image, imageData.x, imageData.y, imageData.r, 0.5, 0.5, 256/2, 256/2) else image:release() ImagesToDraw[image] = nil currentCoins = currentCoins - 1 end end end Deletion ...
by pgimeno
Mon Mar 25, 2024 4:18 pm
Forum: Libraries and Tools
Topic: Fast 2D point-in-polygon test
Replies: 13
Views: 11699

Re: Fast 2D point-in-polygon test

I'm concerned about this condition in your code: if py ~= lastY then Does that mean that polygons with vertical segments can't be used? From my tests, they can be used. For example, the polygon in the OP has some neighboring points with the same vertical coordinates (py == lastY), and the same hori...
by pgimeno
Sun Mar 24, 2024 2:20 pm
Forum: Libraries and Tools
Topic: Fast 2D point-in-polygon test
Replies: 13
Views: 11699

Re: Fast 2D point-in-polygon test

Ehhh, here's something weird. From my tests, that Lua-based method in the OP is slightly faster than the Box2D one. Point for LuaJIT I guess, it's probably optimizing that function amazingly. I honestly thought the C++ one would be faster. I'm not too surprised. In LuaJIT, external function calls v...
by pgimeno
Wed Mar 20, 2024 10:51 pm
Forum: Support and Development
Topic: Why fonts look different on LOVE than on web browser?
Replies: 5
Views: 1261

Re: Why fonts look different on LOVE than on web browser?

This looks like if anything, it should be reported to FreeType.
by pgimeno
Sun Mar 17, 2024 9:54 pm
Forum: General
Topic: sh + love bundled in one file - is this intended behaviour?
Replies: 19
Views: 2272

Re: sh + love bundled in one file - is this intended behaviour?

It'd need to provide the exact same thing as a (perhaps unpacked) appimage of love at that point, right? Since you'd also want all of love's dependencies to be the version you made your game for as well otherwise you'll run into similar problems. <snip> I'm not sure how any of that is relevant when...
by pgimeno
Sun Mar 17, 2024 1:22 pm
Forum: Games and Creations
Topic: 3D Physics Engine
Replies: 11
Views: 2645

Re: 3D Physics Engine

That's pretty impressive!
by pgimeno
Sun Mar 17, 2024 1:16 pm
Forum: General
Topic: sh + love bundled in one file - is this intended behaviour?
Replies: 19
Views: 2272

Re: sh + love bundled in one file - is this intended behaviour?

I don't think this is usually true. As a game developer you wouldn't want to rely on a global install of love on someone else's system having a version that's coincidentally compatible with your code. And if you use something like Unity instead of love and it somehow allowed that (which it doesn't)...