tresinformal / drakkar

The tresinformal video game called 'Drakkar'
GNU General Public License v3.0
11 stars 4 forks source link

Truncate the displayed coordinates #456

Closed TheoPannetier closed 2 years ago

TheoPannetier commented 2 years ago

The numbers showing object coordinates in the top-right corner are useful, but look a bit awkward. There are a bunch of decimals printed there, yet if you run the game you'll see that their value is always zero. So these numbers don't carry any useful information for us, and impede reading. Find a way to either truncate the numbers (maybe by converting them to integers before drawing?), or make the string only display the integer part of the coordinate.

EvoLandEco commented 2 years ago

trunc(get_x(p)) doesn't work, I guess it is because trunc() also returns a double? Explicit type conversion works here: (int)get_x(p), and by doing this we can display only integers on the fourth panel image

richelbilderbeek commented 2 years ago

Note: prefer using static_cast<int> over (int), see ES.49: If you must use a cast, use a named cast :-)