Search found 2596 matches

by pgimeno
Fri Apr 16, 2021 11:07 am
Forum: Support and Development
Topic: Coordinates for lines vs points (and pixel grid alignment for points)
Replies: 20
Views: 1374

Re: Coordinates for lines vs points (and pixel grid alignment for points)

Well, I was wrong, but not by much. As it turns out, the rounding depends on whether the line is horizontal or vertical, and there are good reasons for that. First, let's talk about filled rectangles. Rectangles don't have the same problems as lines, because they have an edge. You place the top left...
by pgimeno
Wed Apr 14, 2021 4:29 pm
Forum: Support and Development
Topic: Coordinates for lines vs points (and pixel grid alignment for points)
Replies: 20
Views: 1374

Re: Coordinates for lines vs points (and pixel grid alignment for points)

I see no inconsistency in behaviour. There seems to be some inconsistency in the rounding performed by your graphics card driver when drawing points, which I believe is an OpenGL native operation, while love.graphics.line is polygon-based, so the rounding for lines is performed on the Löve side. The...
by pgimeno
Tue Apr 13, 2021 11:31 am
Forum: Support and Development
Topic: Coordinates for lines vs points (and pixel grid alignment for points)
Replies: 20
Views: 1374

Re: Coordinates for lines vs points (and pixel grid alignment for points)

It's just natural that coordinates work that way. The edges of the pixels are at integral positions, the centres are at a distance of 0.5 from either edge. It's the same for lines and rectangles; try drawing horizontal or vertical lines, or rectangles in line mode, at integer coordinates with love.g...
by pgimeno
Tue Apr 13, 2021 2:31 am
Forum: Support and Development
Topic: Multidimentional arrays/Tables
Replies: 14
Views: 1679

Re: Multidimentional arrays/Tables

It depends, even in LuaJIT. Undefined is the right word.

Code: Select all

$ luajit -e 'print(#{1,2,nil,4})'
4
by pgimeno
Mon Apr 12, 2021 9:59 am
Forum: Support and Development
Topic: How much C++ really improves Love?
Replies: 4
Views: 732

Re: How much C++ really improves Love?

There are modules wrote in C/C++ that can be loaded simply by require(), since they implement functions that can be exposed directly to Lua. I tried that and it's pretty easy, but I can't compile the code of the library into a dll so that Love can require it. So my question is: Is there any guideli...
by pgimeno
Mon Apr 12, 2021 1:37 am
Forum: Support and Development
Topic: How much C++ really improves Love?
Replies: 4
Views: 732

Re: How much C++ really improves Love?

Assuming I have not been rickrolled... :D 1. Is it really worthy to write a module in C++, instead of Lua in the context of Love? If so, any good suggestions on how to actually do it? Hard to say whether it's worth or not. Probably not, at least from the perspective of the multi-platform compilation...
by pgimeno
Sun Apr 11, 2021 1:18 pm
Forum: Support and Development
Topic: If statement and Goto
Replies: 38
Views: 5147

Re: If statement and Goto

darkfrei wrote: Sun Apr 11, 2021 11:39 am
pgimeno wrote: Sun Apr 11, 2021 11:04 am I wrote about one way of dealing with states, starting here: https://love2d.org/forums/viewtopic.php ... 26#p194226

Take a look, see if that helps you wrap around your head around it.
How I can understand which stete is enabled?
Do you mean for debugging? You can add a 'name' field.
by pgimeno
Sun Apr 11, 2021 11:04 am
Forum: Support and Development
Topic: If statement and Goto
Replies: 38
Views: 5147

Re: If statement and Goto

I wrote about one way of dealing with states, starting here: https://love2d.org/forums/viewtopic.php ... 26#p194226

Take a look, see if that helps you wrap around your head around it.
by pgimeno
Sat Apr 10, 2021 4:37 pm
Forum: Games and Creations
Topic: SnowFlakes
Replies: 5
Views: 749

Re: SnowFlakes

Brings memories of Track & Field, hehe. Nice. Level 14 might be the maximum humanly possible in a decent graphics card (I got there too; my spacebar is going to sue me for abuse), but by setting love.keyboard.setKeyRepeat(true) it can be shown that it's not the maximum level attainable. In my de...
by pgimeno
Sat Apr 10, 2021 3:15 pm
Forum: General
Topic: Physics and dt
Replies: 1
Views: 590

Re: Physics and dt

The force applied by applyForce should not be multiplied by dt in principle. It lasts the duration of dt that you pass to world:update(); if you want it to be applied for longer, you have to apply it multiple times.