Search found 2311 matches

by pgimeno
Thu Oct 15, 2020 8:50 am
Forum: Support and Development
Topic: Having trouble randomizing simple tilesets
Replies: 5
Views: 471

Re: Having trouble randomizing simple tilesets

Yes, though I wouldn't really call it cleaner, actually. In my opinion, inventing dialects hinders readability. I'd only use that construct if accompanied by a bigger comment than the one I've used, and only if justified by the savings. In this case, I think the savings are too small to justify it, ...
by pgimeno
Wed Oct 14, 2020 3:02 pm
Forum: Support and Development
Topic: Having trouble randomizing simple tilesets
Replies: 5
Views: 471

Re: Having trouble randomizing simple tilesets

I just had this funny idea. Note that for the sake of clarity, I certainly don't recommend doing this, but I wanted to post it for fun. It's actually possible to use your original map constructor; note that this is a sort of advanced use of Lua. function love.load() ... local saveGMT = getmetatable(...
by pgimeno
Wed Oct 14, 2020 11:52 am
Forum: Support and Development
Topic: Having trouble randomizing simple tilesets
Replies: 5
Views: 471

Re: Having trouble randomizing simple tilesets

Hi, welcome to the forums. You're setting a variable to a random number, and then using that number multiple times in your map. This means that you're not actually generating a different number per tile; that would require calling the random function once per tile. For brevity, I suggest this: funct...
by pgimeno
Tue Oct 13, 2020 8:24 pm
Forum: Support and Development
Topic: Created .exe, when running .exe error unable to load audio file
Replies: 26
Views: 1287

Re: Created .exe, when running .exe error unable to load audio file

The error message says: "attempt to index field 'audio' (a nil value)". This says that: 'audio' is a field of a table (keyword: field ). The only table that fits in the line given is 'love'; The 'audio' field is nil ; the code is attempting to access an index inside of 'audio' but 'audio' is nil ins...
by pgimeno
Mon Oct 12, 2020 12:15 pm
Forum: Support and Development
Topic: Created .exe, when running .exe error unable to load audio file
Replies: 26
Views: 1287

Re: Created .exe, when running .exe error unable to load audio file

That can't be it, then, because it either works or doesn't work, and doesn't affect love.audio.

I'm out of ideas as to why love.audio can be nil at that point, and only when the executable is fused.
by pgimeno
Mon Oct 12, 2020 11:27 am
Forum: Support and Development
Topic: Touchmoved function
Replies: 4
Views: 448

Re: Touchmoved function

I still have another questions are about the touch functions: 1) How can I access the values of x, y, dx, dy? I tried this for my code inside draw method: love.graphics.printf("touchesx: " .. tostring(touches['x']), 0, 30, 800, 'center') love.graphics.printf("touchesy: " .. tostring(touches['y']), ...
by pgimeno
Sun Oct 11, 2020 10:32 pm
Forum: Support and Development
Topic: Touchmoved function
Replies: 4
Views: 448

Re: Touchmoved function

First thing, you misspelled "update". It's "love.update", not "love.update d ". Second thing, min and max are reversed. It seems intuitive to say "I want the minimum to be zero" and write math.min(0, n) but it actually works the other way around. The minimum of 0 and -7 is -7. The minimum of 0 and 7...
by pgimeno
Sun Oct 11, 2020 10:59 am
Forum: Support and Development
Topic: Created .exe, when running .exe error unable to load audio file
Replies: 26
Views: 1287

Re: Created .exe, when running .exe error unable to load audio file

If it was the first line of the file, it means that the contents don't matter; the problem was already present when getting there.

The only possible explanation I can think of is that some part of the code removed 'audio' from the love table. It would be interesting to see function requireFiles().
by pgimeno
Sun Oct 11, 2020 1:37 am
Forum: Support and Development
Topic: Created .exe, when running .exe error unable to load audio file
Replies: 26
Views: 1287

Re: Created .exe, when running .exe error unable to load audio file

Hmm, perhaps you're missing a DLL or something like that. I don't have experience with Windows, sorry. "Once you have your game executable you can pack it together with all the other DLL files of the official LÖVE .zip file into a new .zip file and share this with the world." https://love2d.org/wiki...
by pgimeno
Sun Oct 11, 2020 1:12 am
Forum: Support and Development
Topic: Created .exe, when running .exe error unable to load audio file
Replies: 26
Views: 1287

Re: Created .exe, when running .exe error unable to load audio file

Well, that's intriguing. What the error message is saying, is that love.audio is not defined (but love is).

Do you have the audio module enabled in conf.lua?