Search found 2044 matches

by zorg
Sat Feb 17, 2018 1:05 pm
Forum: Support and Development
Topic: Disable key repeat?
Replies: 17
Views: 292

Re: Disable key repeat?

By isUp I obviously meant key released. Detecting if the keyboard is not down would detect what happens the entire game apart from when the key is down... I was just remarking that the other languages I used they all had several stage IF checks for the keyboard presses. So I found it strange that l...
by zorg
Sat Feb 17, 2018 3:25 am
Forum: Support and Development
Topic: Disable key repeat?
Replies: 17
Views: 292

Re: Disable key repeat?

It's extremely strange to only have love.keyboard.isDown...where's isUp?? It's like having a boolean with only false as a choice. Yes, because you can't do something like if not love.keyboard.isDown(key) then end right? Boolean logic functions don't need unnecessary complement functions, although f...
by zorg
Sat Feb 17, 2018 2:18 am
Forum: Support and Development
Topic: Enumerate files outside of root / save directory, recursively
Replies: 22
Views: 421

Re: Enumerate files outside of root / save directory, recursively

...I still disagree with this one; the snippet i reposted should fix all problems without needing to call ffi.C.PhysFS_mount more than once and check whether it failed. ... assuming the Windows version is not statically linked like my Linux versions are. I didn't suggest calling it, just trying to ...
by zorg
Sat Feb 17, 2018 2:12 am
Forum: Support and Development
Topic: Ternary operator for just two possibilities?
Replies: 9
Views: 187

Re: Ternary operator for just two possibilities?

other than what metatables offer (which isn't much), using metaprogramming with löve may be harder than what's it worth.
by zorg
Fri Feb 16, 2018 5:15 pm
Forum: Support and Development
Topic: Enumerate files outside of root / save directory, recursively
Replies: 22
Views: 421

Re: Enumerate files outside of root / save directory, recursively

If this only happens because you tried to do ffi.load("love") then you missed the fact that on linux, you don't do that. I was just objecting to coffeecat's proposal to always load love: This semantics is probably related to the fact that "Windows symbols are bound to a specific DLL name", while sy...
by zorg
Fri Feb 16, 2018 5:13 pm
Forum: Support and Development
Topic: Disable key repeat?
Replies: 17
Views: 292

Re: Disable key repeat?

You can use keypressed, keyreleased and isDown in update to simulate a 4-stage system (pressed,held,released,"free"), and obviously you only want the state when a key wasn't pressed before, but got pressed down, and isn't being held.
by zorg
Fri Feb 16, 2018 12:05 pm
Forum: Support and Development
Topic: Enumerate files outside of root / save directory, recursively
Replies: 22
Views: 421

Re: Enumerate files outside of root / save directory, recursively

I think the best practice is to always use ffi.load("love"). It's an already loaded dynamic library, and each dynamic library is loaded at most one time for one executable. Therefore ffi.load("love") does no actual loading. Does not work for me in Linux. $ love . Error: main.lua:8: liblove.so: cann...
by zorg
Fri Feb 16, 2018 3:11 am
Forum: Support and Development
Topic: Enumerate files outside of root / save directory, recursively
Replies: 22
Views: 421

Re: Enumerate files outside of root / save directory, recursively

EDIT: So here is my working function. I could not use isDirectory, because it was always returning false. I think this is an issue with PhysFS. I solved it by calling recursion in any case and trying to get directory items of files, too. isDirectory may also be coded in such a way to insta-return f...
by zorg
Thu Feb 15, 2018 1:14 pm
Forum: Support and Development
Topic: Enumerate files outside of root / save directory, recursively
Replies: 22
Views: 421

Re: Enumerate files outside of root / save directory, recursively

Here's a quick test how zorg's idea works to mount the root directory. I don't know about the intricacies of PhysFS - I just tested this quickly in Linux and it seems to work fine. local ffi = require('ffi') ffi.cdef [[ int PHYSFS_mount(const char *newDir, const char *mountPoint, int appendToPath);...
by zorg
Thu Feb 15, 2018 1:11 pm
Forum: Support and Development
Topic: How to remove an item that is picked up?
Replies: 2
Views: 59

Re: How to remove an item that is picked up?

So if you have something like this in a file: return { {'ball','toy',1,1}, {'chair','furniture',2,1}, {'desk','furniture',3,1}, } and you load it into a table called items, let's say, then your code already checks against the position of the items, which means you also know the index of one item in ...