Skip to content

Commit

Permalink
Add _update_children function
Browse files Browse the repository at this point in the history
  • Loading branch information
plbrault committed Jul 3, 2024
1 parent a2b9e12 commit c23fcac
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/game_objects/process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,7 @@ def _handle_sorting(self):
if self._sort_in_progress or self._auto_sort_enabled:
self._continue_sorting()

def update(self, current_time, events):
if self._check_game_over():
return

self._handle_events(events)
self._handle_process_creation(current_time)
self._handle_timed_powerups(current_time)
self._handle_sorting()

def _update_children(self, current_time, events):
for game_object in self.children:
game_object.update(current_time, events)
if (
Expand All @@ -373,3 +365,13 @@ def update(self, current_time, events):
and game_object.view.y <= -game_object.view.height
):
self.children.remove(game_object)

def update(self, current_time, events):
if self._check_game_over():
return

self._handle_events(events)
self._handle_process_creation(current_time)
self._handle_timed_powerups(current_time)
self._handle_sorting()
self._update_children(current_time, events)

0 comments on commit c23fcac

Please sign in to comment.