Search found 2122 matches

by pgimeno
Sun May 24, 2020 12:35 am
Forum: General
Topic: Code Doodles!
Replies: 156
Views: 78084

Re: Code Doodles!

While I was watching this demo by Melon Dezign, the shadebobs effect caught my attention. I wondered if I would be able to replicate it with Löve to any degree of accuracy, and well, while it's not identical, I'm pretty satisfied with this result. The first three effects use parameters that mimic th...
by pgimeno
Sat May 23, 2020 11:12 am
Forum: Support and Development
Topic: Load from file
Replies: 11
Views: 354

Re: Load from file

Thank you, I understand :nyu: But I still have "test_output.txt" empty after running the code It seems that the values do not write to it. Your code works for me. Are you sure the input file has the right contents? Are you sure you're looking at the right output file? test_output.txt should be in t...
by pgimeno
Sat May 23, 2020 11:05 am
Forum: Support and Development
Topic: [ANSWERED] Question about My Method of Animation and Quads
Replies: 2
Views: 87

Re: Question about My Method of Animation and Quads

In general I'd prefer method 1. Only if you have serious memory problems because you have lots and lots of animations (hence lots and lots of quads) in a very restricted system, then you can trade speed for memory and go with approach 2. I doubt memory would ever be a problem that can be solved that...
by pgimeno
Sat May 23, 2020 1:14 am
Forum: Support and Development
Topic: Load from file
Replies: 11
Views: 354

Re: Load from file

What I meant was to write this:

Code: Select all

love.filesystem.write("test_output.txt", table.concat(x, "\n"))
Without any 'for' loop, without [ i ] indexing.

"\n" means newline. If you want them separated in some other way, just use the appropriate separator.
by pgimeno
Fri May 22, 2020 3:13 pm
Forum: Support and Development
Topic: Load from file
Replies: 11
Views: 354

Re: Load from file

And one more question please :crazy: And now, I have data in the field, e.g. lines[1] = 150 lines[2] = 200 lines[3] = 350 ... How to make SAVE to file? Thank you so much again! :nyu: You can use this: love.filesystem.write(filename, table.concat(lines, "\n")) As for your previous question, you have...
by pgimeno
Fri May 22, 2020 3:06 pm
Forum: General
Topic: Removing a table from another table
Replies: 5
Views: 109

Re: Removing a table from another table

Yeah and it is probably treated as an array internally, but I think we need an operative definition, not an implementation-based definition. Relying on the underlying implementation is a disaster waiting to happen. (Edit: Also, Lua 5.2 calls them sequences, and defines them as "a table where the set...
by pgimeno
Fri May 22, 2020 8:06 am
Forum: General
Topic: Removing a table from another table
Replies: 5
Views: 109

Re: Removing a table from another table

zorg wrote:
Fri May 22, 2020 7:33 am
the array part is whichever n,n+1,...,n+k continuous sequence of positive whole numbers that lua decides is the array part.
Only for n = 1 :)
by pgimeno
Thu May 21, 2020 8:57 pm
Forum: Support and Development
Topic: bug when trying to rotate gun to mouse cursor position using math.atan ?
Replies: 3
Views: 141

Re: bug when trying to rotate gun to mouse cursor position using math.atan ?

These special cases are precisely what math.atan2 is for :)

Well, that, and also to be more accurate. You can simply use:

Code: Select all

local angle = math.atan2(love.mouse.getY() - y, love.mouse.getX() - x)
by pgimeno
Wed May 20, 2020 2:55 pm
Forum: Support and Development
Topic: attempt to index field 'graphics' (a nil value)
Replies: 3
Views: 106

Re: attempt to index field 'graphics' (a nil value)

Can you show the first three lines of "var.lua" to us?
by pgimeno
Tue May 19, 2020 11:59 am
Forum: Support and Development
Topic: How to properly setup Love2D - LUA on Windows 10 ?
Replies: 8
Views: 288

Re: How to properly setup Love2D - LUA on Windows 10 ?

steliosPaf wrote:
Tue May 19, 2020 10:23 am
Is it really a good move starting on a older Lua version?
LuaJIT only supports 5.1, and the speed advantage is overwhelming (often 20x). Many projects would not even be possible with the normal Lua interpreter.