Lets Talk 2D Platformers!

General discussion about LÖVE, Lua, game development, puns, and unicorns.

What kind of method do you like the most?

Tiled (Pure)
3
18%
Tiled (Smooth)
10
59%
Bitmask
1
6%
Vectorial
3
18%
 
Total votes: 17

User avatar
micha
Inner party member
Posts: 1083
Joined: Wed Sep 26, 2012 5:13 pm

Re: Lets Talk 2D Platformers!

Post by micha »

Ekamu wrote:Personally for anything tile-based I avoid using dt or I math.floor the final number to keep things tight. Pixels also behave very strangely in between floating point positions.
Using floating point numbers for coordinates is not problem, if you separate the game logic from the drawing. I highly recommend using dt.

In my project, I have logic coordinates, with a scale where one unit means "length of 1 tile". Internally all calculations are based on these coordinates. Then in the drawing function, the coordinates are multiplied by the tile size and rounded with math.floor to get the screen coordinates. If you restrict the coordinates to being integers, you lose precision (I have to admit, that it might not be noticeable).
Post Reply

Who is online

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