Improve formatting of numbers in Land Safe activity
Closed, ResolvedPublic

Description

My kids love playing the Land Safe activity in https://gcompris.net/download/qt/linux/beta/gcompris-qt-1.0-beta-Linux64.sh.

I think it would be better if the formatting of the numbers were a bit more consistent. The text is right aligned and the numbers are on at the end of these lines, so as number of characters on a given line changes, the whole line "bounces" in and out. This behavior is the most extreme for

  • the line of text displaying the velocity when landing on the Earth (which is the case for levels 7 and 14) because the acceleration is the highest (so the velocity is changing the fastest) or
  • the line of text displaying the acceleration when the rocket spins around by holding one of the left or right arrow buttons (which is only possible on levels 8 - 14 and would only happen when messing around).

For each line of text, I state its initial value(s) and (typical) range, my recommendation for how to format the value, and what some examples with this formatting would look like.

  • Fuel:
    • Always starts at 100 and is always within [0, 100].
    • Left pad with the space character to a minimum length of 3.
    • Examples include "100", " 99", and " 9".
  • Altitude:
    • Starts at 75, 100, 150, 200, 250, or 300 and is typically within [0, 300]. Larger values are possible, but really only when trying to go as high as possible for fun.
    • Left padded with the space character to a minimum length of 3.
    • Examples include "300", " 75", and " 0".
  • Velocity:
    • Always starts at 0 and is typically within [-10, 999.9].
    • Always show exactly one digit to the right of the decimal point. Left pad to the left of the decimal point with the space character to a minimum length of 3 (including the negative sign).
    • Examples include "-10.0", " -9.5", " 0.0", " 3.4", " 56.4", and "999.9".
  • Acceleration:
    • Starts at -0.27, -0.62, -1.35, -1.62, -3.71, -8.87, or -9,81. Range is [-23.54, 4.44] and a common value is 0.
    • Always display two digits to the right of the decimal point. Left pad to the left of the decimal point by the space character to a minimum length of 3 (including the negative sign).
    • Examples include "-23.54", " -4.30", " 0.00", and " 4.44".
timotheegiet added a subscriber: timotheegiet.

Thanks for the useful feedback!

I'll take a look at this, it should be doable without breaking the string freeze by manipulating the arguments.

Yep, that is right. I am just recommending better formatting of numbers. No effect on the string freeze.

timotheegiet closed this task as Resolved.Sep 16 2020, 5:26 PM

Fixed in commit 29e6b0a986a659104851d73e296a54ddcfab7289

The formatting of the numbers is great now. Good work :)