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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
darkfrei
Party member
Posts: 1197
Joined: Sat Feb 08, 2020 11:09 pm

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

Post by darkfrei »

pgimeno wrote: Tue May 04, 2021 1:29 pm Can't reproduce. I get 10 both times, not 10.0.

Edit: Ah, it happens in Lua 5.3, which has separate integer and float types. Löve only supports 5.1.
Normal program languages have a lot of data types and the variable cannot change the type of it.

I think that's possible to make such multi-types-data as:
a = {table = {1,2}, bool = true, integer = 4, double = 1.33, string ="some text", type = "integer"}

And the value of it will be called as
value (a) = a[a.type].

Of coarse other types are empty.
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests