-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Connect 4 Visualization for Dynamic Board Sizes #25
Conversation
|
||
self.screen.blit(board_img, (0, 0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The window resizing seems to work only for changed board width, not for changed board height (e.g. with a board height of >6 cells)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed this issue now
@@ -297,43 +297,52 @@ def render(self): # TODO adapt to different board sizes, low priority | |||
if self.render_mode == "human": | |||
pygame.display.set_caption("Connect Four") | |||
self.screen = pygame.display.set_mode((screen_width, screen_height)) | |||
elif self.render_mode == "rgb_array": | |||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have kept the elif
I implemented a dynamic board visualization using the single empty cell image from the original connect4 board. Needs fine tuning, some pixels are off causing tear, but the tiles seem to work fine.
Example: