Skip to content

Commit

Permalink
reformatted with black
Browse files Browse the repository at this point in the history
  • Loading branch information
lily-way committed May 1, 2024
1 parent 8a319ab commit d58d4e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 32 deletions.
6 changes: 2 additions & 4 deletions controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ def update_game_over(self):
def jumping(self):
"""
Returns the jumping bool as a private attribute
Args:
none
Returns:
If the player is jumping or not as boolean
"""
Expand All @@ -100,8 +99,7 @@ def jumping(self):
def left_right(self):
"""
Returns the horizontal movement as a private attribute
Args:
none
Returns:
The horizontal acceleration of the character as a float
"""
Expand Down
33 changes: 5 additions & 28 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,11 @@ def calculate_x_landing(self, max_left, max_right):
int(max_right - (full_range / 2) * (1 - self._game_difficulty)) - 1
)
# Calculate landing x value
x_landing = random.choice(
[
i
for i in range(max_left, max_right)
if i not in range(minimum_left_x, minimum_right_x)
]
)
x_landing = random.choice([
i
for i in range(max_left, max_right)
if i not in range(minimum_left_x, minimum_right_x)
])
return x_landing

def calculate_platform_center_x(
Expand Down Expand Up @@ -371,9 +369,6 @@ def set_difficulty(self, difficulty):
def increase_score(self):
"""
Increases the private attribute _score by 1
Args:
none
"""
self._score += 1

Expand Down Expand Up @@ -534,9 +529,6 @@ def __init__(self, gravity, friction) -> None:
def update(self):
"""
Updates the character rect based on position
Args:
none
"""
self._rect = self._image.get_rect(center=self._position)

Expand Down Expand Up @@ -585,9 +577,6 @@ def jump_velocity(self):
Returns the players jump velocity, dependent on
whether or not player is jumping
Args:
none
Returns:
_velocity as an int representing the y
velocity the player is set to when jumping
Expand All @@ -599,9 +588,6 @@ def acceleration(self):
"""
Allows the acceleration of player to be accessed
Args:
none
Returns:
_acceleration of player in form of float
"""
Expand All @@ -612,9 +598,6 @@ def velocity(self):
"""
Allows the velocity of player to be accessed
Args:
none
Returns
_velocity of player in form of float
"""
Expand All @@ -625,9 +608,6 @@ def position(self):
"""
Allows the position of the player to be accessed
Args:
none
Returns:
The _position attribute of the model.
"""
Expand All @@ -649,9 +629,6 @@ def rect(self):
"""
Allows the rectangle object of the player to be accessed
Args:
none
Returns:
The _rect attribute of the model.
"""
Expand Down

0 comments on commit d58d4e7

Please sign in to comment.