Пример #1
0
 def _offset_direction_fix(self, x, y, width, height, slope):
     hitpoint = MathUtils.calc_y_at_distance(x, y, width, slope)
     bounces = MathUtils.calc_folds(hitpoint, height)
     return 1 if bounces % 2 == 0 else -1
Пример #2
0
 def _slope_l(self, x, y, height, slope):
     hitpoint = MathUtils.calc_y_intercept(x, y, slope)
     bounces = MathUtils.calc_folds(hitpoint, height)
     return slope * (1 if bounces % 2 == 0 else -1 )
Пример #3
0
 def _hitpoint_l(self, x, y, height, slope):
     hitpoint = MathUtils.calc_y_intercept(x, y, slope)
     return MathUtils.calc_folded_point(hitpoint, height)
Пример #4
0
 def _hitpoint_r(self, x, y, width, height, slope):
     hitpoint = MathUtils.calc_y_at_distance(x, y, width, slope)
     return MathUtils.calc_folded_point(hitpoint, height)
Пример #5
0
 def get_slope(self, other):
     return MathUtils.calc_slope(self.ball_x, self.ball_y, other.ball_x, other.ball_y)