Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonMoffon committed Nov 13, 2024
1 parent 0426e74 commit bbb8764
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arcade/camera/grips/screen_shake_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ class ScreenShake2D:
the target frame-rate. (e.g. at 60 fps avoid 30, 60, 90, 120, etc.)
shake_angle:
The angle around which the shake will focus. Defaults to 0 (horizontal)
This is actuall 0 or 180 degress as the shake angle is mirrored.
shake_range:
The range in degrees from the shake angle that the shake may fall within.
defaults to 90 degrees. This gives a range of +/- 90 degrees which covers the full circle because
the shake is mirrored across the circle.
defaults to 90 degrees. This gives a range of +/- 90 degrees which covers the
full circle because the shake angle is mirrored 180 degrees.
"""

def __init__(
Expand Down Expand Up @@ -286,7 +287,8 @@ def update_camera(self) -> None:
floor(self._last_update_time * 2 * self.shake_frequency)
< floor(self._length_shaking * 2.0 * self.shake_frequency)
) or self._last_update_time == 0.0:
# Start from the shake angle and then offset by the reflected shake range, then randomly pick whether to mirror to the other side.
# Start from the shake angle and then offset by the reflected shake range,
# then randomly pick whether to mirror to the other side.
self._current_dir = (
self.shake_angle
+ uniform(-self.shake_range, self.shake_range)
Expand Down Expand Up @@ -327,4 +329,4 @@ def __enter__(self):

def __exit__(self, exc_type, exc_val, exc_tb):
self.readjust_camera()
return False
return False

0 comments on commit bbb8764

Please sign in to comment.