コード例 #1
0
ファイル: engine.py プロジェクト: dratini/hwo2012-pingpongbot
 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
ファイル: engine.py プロジェクト: dratini/hwo2012-pingpongbot
 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 )