Search found 1736 matches

by ivan
Wed Mar 10, 2021 8:49 am
Forum: General
Topic: How to get the size of a table/object in love2d
Replies: 7
Views: 2640

Re: How to get the size of a table/object in love2d

#tabl only works for numerically-indexed tables without gaps.
For all other tables you have to use darkfrei's method to count the number of non-nil elements.
Check out my table.lua library for similar functions: https://bitbucket.org/itraykov/table.lua/src/master/
by ivan
Wed Mar 10, 2021 6:00 am
Forum: Libraries and Tools
Topic: Steamworks FFI
Replies: 33
Views: 43944

Re: Steamworks FFI

Ok good catch there. This was changed a while ago but I forgot to update the example script. The callback function now returns a status upfront so: steam.queryUGC("recent", 1, 10, function(ok, list, total) assert(ok, "query failed") totalugc = total end) Also found a couple of mi...
by ivan
Tue Mar 09, 2021 8:35 am
Forum: Libraries and Tools
Topic: Steamworks FFI
Replies: 33
Views: 43944

Re: Steamworks FFI

Just tested the library on Ubuntu and it worked fine. I can't test every Linux distribution out there, but I can release a patch if you figure out what is causing this issue. For starters I recommend making sure that your Steam client is up to date and running. Also check that you have the appropria...
by ivan
Wed Feb 24, 2021 10:57 am
Forum: Libraries and Tools
Topic: love.maker (automated distribution + minification)
Replies: 23
Views: 20331

Re: love.maker (automated distribution + minification)

Ok, I tried building the project and looks like the minifier doesn't like the syntax:

Code: Select all

func{param1=true}.foo
I will try to get that fixed, but it's not my code so it may take a while.
Thanks for the bug report!
by ivan
Thu Feb 18, 2021 5:57 pm
Forum: Support and Development
Topic: How would one check if a square is within a circle?
Replies: 11
Views: 3216

Re: How would one check if a square is within a circle?

I haven't looked it up, but ok I'll trust your solution, pgimeno. :)
by ivan
Thu Feb 18, 2021 2:26 pm
Forum: Support and Development
Topic: How would one check if a square is within a circle?
Replies: 11
Views: 3216

Re: How would one check if a square is within a circle?

Good catch there pgimeno! The correct way is to add the radius of the circle to each side of the square, and that will reduce the problem to point vs square which is trivial. Then you can compare the distance from the center point of the circle to the edges of the expanded square against the circle'...
by ivan
Thu Feb 18, 2021 7:53 am
Forum: Support and Development
Topic: How would one check if a square is within a circle?
Replies: 11
Views: 3216

Re: How would one check if a square is within a circle?

I think your example code is fine. Just check the distance from the turret to the center of the enemy, there is no need to involve squares/rectangles. If you insist then here is the code: https://2dengine.com/?p=intersections#Circle_vs_rectangle To determine if the square is *entirely* inside the ci...
by ivan
Wed Feb 17, 2021 8:26 am
Forum: Libraries and Tools
Topic: love.maker (automated distribution + minification)
Replies: 23
Views: 20331

Re: love.maker (automated distribution + minification)

Borr, can you please post the file which is causing this error.

Code: Select all

local reset = "\x1B[m"
The line above seems to work fine with the latest version on BitBucket.
by ivan
Wed Feb 17, 2021 7:18 am
Forum: Libraries and Tools
Topic: love.maker (automated distribution + minification)
Replies: 23
Views: 20331

Re: love.maker (automated distribution + minification)

Thanks! I have added the \x escape sequence to the minifier.
by ivan
Tue Feb 16, 2021 7:07 am
Forum: General
Topic: how to check for errors in the syntax of scripts for love2d?
Replies: 9
Views: 4789

Re: how to check for errors in the syntax of scripts for love2d?

The whole point of superstrict is that it doesn't allow assigning globals. You don't want to be assigning and changing globals from everywhere because it makes the code hard to follow and debug. If this is not your code and you don't want to check it, just add the following line at the top of the pr...