The UI class requires a screen object during its initialization. This PR ensures that the screen object is created in the Game class before initializing the UI class and is passed as an argument during its initialization.
Summary
Created a screen object in the Game class using pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)).
Passed the screen object to the UI class during its initialization: self.ui = UI(self.screen).
This change resolves the TypeError encountered when initializing the UI class without the required screen argument.
Fixes #18.
To checkout this PR branch, run the following command in your terminal:
git checkout sweep/fix-ui-screen-initialization
To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.
Description
The
UI
class requires ascreen
object during its initialization. This PR ensures that thescreen
object is created in theGame
class before initializing theUI
class and is passed as an argument during its initialization.Summary
screen
object in theGame
class usingpygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
.screen
object to theUI
class during its initialization:self.ui = UI(self.screen)
.This change resolves the
TypeError
encountered when initializing theUI
class without the requiredscreen
argument.Fixes #18.
To checkout this PR branch, run the following command in your terminal:
To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.