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

Connect 4 Visualization for Dynamic Board Sizes #25

Merged
merged 6 commits into from
Jan 4, 2024
Merged

Conversation

umutucak
Copy link
Collaborator

@umutucak umutucak commented Dec 24, 2023

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:
image

@umutucak umutucak self-assigned this Dec 24, 2023
@umutucak umutucak changed the base branch from main to mo-games December 24, 2023 14:04

self.screen.blit(board_img, (0, 0))
Copy link
Collaborator

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)

Copy link
Collaborator

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

@rradules rradules requested a review from threepwoody December 25, 2023 16:35
@@ -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:
Copy link
Collaborator

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

@rradules rradules merged commit c6ba193 into mo-games Jan 4, 2024
1 check passed
@rradules rradules deleted the viz/connect-4 branch January 4, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants