Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change methods not using its bound instance to staticmethods #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/Game.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def spawn_item(self, active_items_list):


# Mengurus rendering PowerUp dan check collision dengan bola
def item_handler(self, active_items_list, screen, ball, paddle_right, paddle_left):
@staticmethod
def item_handler(active_items_list, screen, ball, paddle_right, paddle_left):
new_list = []

for item in active_items_list:
Expand Down
6 changes: 4 additions & 2 deletions modules/Loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@
from modules.Player import Player

class Loader:
def load_menu(self):
@staticmethod
def load_menu():
return {
"main_menu": Menu.Main(),
"about_menu": Menu.About("assets/images/about_text.png"),
"info_menu": Menu.About("assets/images/info_text.png"),
"play_menu": Menu.Play()
}

def load_game(self, ball_speed, ball_img = pygame.image.load("assets/game_board/ball_react.png")):
@staticmethod
def load_game(ball_speed, ball_img = pygame.image.load("assets/game_board/ball_react.png")):
return {
"board" : Board(),
"paddle_left" : Paddle(0, 7),
Expand Down