Search found 2575 matches

by pgimeno
Wed Apr 21, 2021 1:56 pm
Forum: Support and Development
Topic: Trouble with screenshots
Replies: 5
Views: 123

Re: Trouble with screenshots

The real problem here was that 'release' does not result in a falsy (i.e. false or nil) value, but you were checking for falsy in some places. Use cases... well, it depends. I imagine that if your code is organized in such a way that you can't immediately set a variable when you release it (e.g. if ...
by pgimeno
Wed Apr 21, 2021 10:35 am
Forum: Support and Development
Topic: FFI: How to store a tcp client object in a more efficient way?
Replies: 7
Views: 146

Re: FFI: How to store a tcp client object in a more efficient way?

Wait for Löve 11.4, it will come with LuaJIT 2.1, which supports much more memory in 64-bit systems (I've seen 128 TB mentioned, not sure if that's accurate).
by pgimeno
Tue Apr 20, 2021 11:34 pm
Forum: Support and Development
Topic: Trouble with screenshots
Replies: 5
Views: 123

Re: Trouble with screenshots

What's happening is that you're calling release without clearing the variable. This is especially important in states/fail.lua.
by pgimeno
Tue Apr 20, 2021 10:56 am
Forum: Support and Development
Topic: [SOLVED] Changing frequency while synthesising sine wave
Replies: 7
Views: 207

Re: Changing frequency while synthesising sine wave

This seems to work: return function(freq) phase = phase + tau * increment * freq generator.phase = phase return math.sin(phase) end Why is it different, I haven't stopped to analyse yet. By the way, you can save a multiplication by pre-calculating tau * increment. Edit: Intuitively, the phase shift ...
by pgimeno
Tue Apr 20, 2021 10:24 am
Forum: Support and Development
Topic: String to access nested table value.
Replies: 7
Views: 209

Re: String to access nested table value.

It's weird to have movement defined in such a file. Usually, movement needs custom logic - handling collisions, at least. There may be types of movements that you handle separately, but I'd rather have a field "movement_type" or something like that for these cases. Then your code would hav...
by pgimeno
Mon Apr 19, 2021 7:40 pm
Forum: Support and Development
Topic: I'm about to make my own keyboard layout maps
Replies: 3
Views: 114

Re: I'm about to make my own keyboard layout maps

What I'm currently doing is use keypressed/keyreleased for all non-character keys. This works flawlessly. And textinput + setKeyRepeat for everything else - the first char of the text is my key and it is considered pressed until the emulated system is done polling the keyboard once. That works well...
by pgimeno
Mon Apr 19, 2021 7:07 pm
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 19
Views: 637

Re: Efficiently drawing a grid map

I thought sprite batching became automatic in Love a few versions ago? Am I mistaken about what that meant? I mention that later on. https://love2d.org/forums/viewtopic.php?p=240186#p240186 Manual batching is still available. As I mention in that post, I'm not sure whether it improves performance o...
by pgimeno
Mon Apr 19, 2021 6:28 pm
Forum: Support and Development
Topic: I'm about to make my own keyboard layout maps
Replies: 3
Views: 114

Re: I'm about to make my own keyboard layout maps

Whew, have you peeked down that rabbit hole and noticed its depth? Android does not generate accurate key down/up events. I don't remember the details but I think it generated both at the same time, or did not generate one of them, or something like that. IIRC it also generated textinput before keyp...
by pgimeno
Mon Apr 19, 2021 5:07 pm
Forum: Support and Development
Topic: String to access nested table value.
Replies: 7
Views: 209

Re: String to access nested table value.

There isn't a direct route. At best, you can make a function to do this kind of access, but it's not the path I'd recommend to follow: local function nested(table, index) for s in index:gmatch("[^%.]+") do table = table[s] end return table end local t = {x=0, y=5, other={z=10}} local zprop...
by pgimeno
Sun Apr 18, 2021 6:24 pm
Forum: Support and Development
Topic: Efficiently drawing a grid map
Replies: 19
Views: 637

Re: Efficiently drawing a grid map

No idea of how your project is structured. But you mentioned a grid, so I imagine that the images to draw in that grid are all of the same size. Create an image whose sides are multiples of the horizontal and vertical size respectively, of the images to include, that is able to fit all the images. T...