Search found 1944 matches

by pgimeno
Fri Jan 24, 2020 3:15 pm
Forum: Support and Development
Topic: Timer to end game
Replies: 1
Views: 118

Re: Timer to end game

You can use a timer library or make your own. If you decide to use one, hump.timer is good. It can be overkill for just one timer, though, so if you decide to make your own, it's easy. Have a variable that tells if the timer is active. If it is, accumulate dt in another variable until the value exce...
by pgimeno
Tue Jan 21, 2020 12:39 am
Forum: General
Topic: Collision not working
Replies: 3
Views: 162

Re: Collision not working

It was a bit difficult to get the program to work for me. I had to find my copy of dkjson.lua and copy it as Json.lua, and enable it at the top, otherwise I got a nil indexing error on the Json global. Then I had another problem with the case of the directories. Once in the .love file, they are case...
by pgimeno
Sun Jan 19, 2020 9:40 pm
Forum: General
Topic: How do you calculate shooting vector [Solved]
Replies: 3
Views: 147

Re: How do you calculate shooting vector

You don't need atan2 for that though. You can use the vector length formula: local function vector_length(x, y) return math.sqrt(x^2+y^2) end Now, the vector from the enemy to the player is given by (player - enemy), that's player.x - enemy.x, player.y - enemy.y. Divide that by its length: local vx ...
by pgimeno
Sun Jan 19, 2020 2:03 pm
Forum: Support and Development
Topic: requiring c module crashes love
Replies: 4
Views: 243

Re: requiring c module crashes love

Maybe try with FFI? It may also have the additional benefit of not slowing down your program.
by pgimeno
Sun Jan 19, 2020 1:03 pm
Forum: Support and Development
Topic: Deterministic ln(x) approximation
Replies: 12
Views: 771

Re: Deterministic ln(x) approximation

Glad you got it working :) leaves me with some serious error magnification too. Since you do 15 iterations, the lowest term you're adding is 0.00003051711247318638 so that's the best error you can aspire to in the logarithm. That of course propagates exponentially when you take the exp(). You can ad...
by pgimeno
Sun Jan 19, 2020 11:42 am
Forum: Support and Development
Topic: beginner OOP problem with rxi classic
Replies: 1
Views: 152

Re: beginner OOP problem with rxi classic

You need : in the second call:

Code: Select all

scene = Stage:new("splash")
I think this may work as well:

Code: Select all

scene = Stage("splash")
by pgimeno
Sun Jan 19, 2020 11:37 am
Forum: Support and Development
Topic: Re: Hash
Replies: 3
Views: 241

Re: Re: Hash

rawdigest = love.data.hash('sha1', '') for i = 1, #rawdigest do io.write(string.format("%02x", rawdigest:byte(i))) end print() works for me, printing da39a3ee5e6b4b0d3255bfef95601890afd80709 which is the SHA-1 hash of the empty string as explained in https://en.wikipedia.org/wiki/SHA-1 . So the wik...
by pgimeno
Wed Jan 15, 2020 6:20 pm
Forum: Support and Development
Topic: [IMPORTANT] Problem with the game distribution.
Replies: 13
Views: 527

Re: [IMPORTANT] Problem with the game distribution.

That's bad because [...] These threads probably have the answers to your questions. If something is still unclear afterwards, please report back. https://love2d.org/forums/viewtopic.php?p=223862#p223862 (I've just added this thread) To address your concerns: 1) They can't do that in the server, whi...
by pgimeno
Tue Jan 14, 2020 12:05 am
Forum: Games and Creations
Topic: nameless platformer
Replies: 5
Views: 456

Re: nameless platformer

Interesting, as a proof of concept :)

I tried cloning from git, and it turns out that the URL of the submodule is the SSH URL, not the HTTP URL. Could you please replace it for the benefit of those who do the same? i.e. replace git@github.com:monolifed/atl.git with https://github.com/monolifed/atl