Change time-dependent values to float/double

Such as movement speed and position. Also add lots of casts to prevent
warnings and unexpected behaviour.