hp method

double hp(
  1. double percent
)

Height percentage: hp(20) = 20% of screen height.

Implementation

double hp(double percent) => screenHeight * (percent / 100);