Search found 3550 matches

by pgimeno
Sat Feb 27, 2021 11:16 am
Forum: Support and Development
Topic: Using an older love version gives out a black screen
Replies: 6
Views: 5173

Re: Using an older love version gives out a black screen

There's cindy too, but it works the other way around. You can use colours in the range 0-255 and include the library only if you're in Löve 11.
by pgimeno
Thu Feb 25, 2021 5:35 pm
Forum: Support and Development
Topic: multiple canvases alpha, not working ?
Replies: 6
Views: 3021

Re: multiple canvases alpha, not working ?

And can i do this, because this is working, or is it better to leave the setBlendMode inside the function? Yes, the default blending mode is "alpha","alphamultiply". As long as you restore it when it's changed in love.draw, you can remove it from the functions. It's a bit like c...
by pgimeno
Thu Feb 25, 2021 12:27 pm
Forum: Support and Development
Topic: multiple canvases alpha, not working ?
Replies: 6
Views: 3021

Re: multiple canvases alpha, not working ?

Uh, good point, I'm doing it wrong. I've edited my answer to remove the setColor call. The docs specify that love.graphics.clear () clears to 0,0,0,0 already, and in any case it never uses the current foreground colour implicitly. Drawing a rectangle is most likely less efficient than love.graphics....
by pgimeno
Thu Feb 25, 2021 12:13 pm
Forum: General
Topic: Any idea in implementing steering behaviour
Replies: 19
Views: 8554

Re: Any idea in implementing steering behaviour

3)What's the difference in 1/dist and 1/distrootsqred? At face value: none. I can't tell about the algorithm, I just wanted to note that this question seems to confuse terms to a point where you're saying the same thing twice. The formula of the distance between two points (x1, y1) and (x2, y2) is:...
by pgimeno
Thu Feb 25, 2021 2:57 am
Forum: Support and Development
Topic: multiple canvases alpha, not working ?
Replies: 6
Views: 3021

Re: multiple canvases alpha, not working ?

How to make the yellow part .50 alpha ? You draw to a canvas that you have previously initialized with RGBA=0,0,0,0 (you can clear it with 0,0,0,0 every frame); you use normal blend mode to draw to the canvas, and when you draw the canvas to the screen, you use premultiplied alpha mode. Note that t...
by pgimeno
Thu Feb 25, 2021 2:43 am
Forum: General
Topic: Any idea in implementing steering behaviour
Replies: 19
Views: 8554

Re: Any idea in implementing steering behaviour

The inverse square of the distance is actually 1/d², it's NOT the square root. Since calculating the distance involves a square root, that square root cancels with the square. The result is:

Code: Select all

function inv_sqr_distance(x1, y1, x2, y2)
  return 1/((x2-x1)^2 + (y2-y1)^2)
end
by pgimeno
Sun Feb 21, 2021 9:28 pm
Forum: Support and Development
Topic: Syntax Error
Replies: 3
Views: 3275

Re: Syntax Error

The above map.lua works for me, and the error is strange because it is reported at line 1 and on end-of-file. Something weird is going on, but since it works for me, I can't help.
by pgimeno
Sun Feb 21, 2021 9:38 am
Forum: Support and Development
Topic: I need a database - options?
Replies: 3
Views: 2840

Re: I need a database - options?

togFox wrote: Sun Feb 21, 2021 8:06 am I notice the last update was 5 years ago. That makes me a little nervous.
No reason to be. The library is not Löve-specific, and Lua 5.1 is around for much longer, plus I don't think the SQLite dynamic library will break ABI compatibility any time soon.
by pgimeno
Sun Feb 21, 2021 3:59 am
Forum: Libraries and Tools
Topic: Groverburger's 3D Engine (g3d) v1.5.2 Release
Replies: 218
Views: 468035

Re: Groverburger's 3D Engine (g3d) v1.3 Release

Sounds sensible.
by pgimeno
Sun Feb 21, 2021 3:49 am
Forum: Support and Development
Topic: I need a database - options?
Replies: 3
Views: 2840

Re: I need a database - options?

I suggest SQLite. I know of this lightweight driver for SQLite: https://github.com/ColonelThirtyTwo/lsqlite3-ffi Unfortunately it's not 100% complete, but it has worked pretty well for me. Apparently forum member shakesoda has another binding, but I haven't checked it: https://github.com/shakesoda/l...