This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Basket-GO/fix/ball-trajectory
Fix/ball trajectory
- Loading branch information
Showing
6 changed files
with
72 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from element import Element | ||
from pygame import Surface | ||
|
||
class Ball(Element): | ||
def __init__(self, surface: Surface, x: int, y: int, visible: bool = True) -> None: | ||
super().__init__(surface, x, y, visible, False) | ||
# this states whether the ball is released or not. | ||
self.__is_released = False | ||
def is_released(self) -> bool: | ||
""" | ||
:return: whether the ball is released or not. | ||
""" | ||
return self.__is_released | ||
def set_released(self, released:bool) -> None: | ||
""" | ||
Set the ball as released or not. | ||
:param bool released: the release state of the ball. | ||
""" | ||
self.__is_released = released |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters