Skip to content

Commit 1b2aba1

Browse files
committed
change the screen dimension og game window
1 parent 01ab462 commit 1b2aba1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

game.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
pygame.init()
1414
pygame.mixer.init() # For sound
1515

16-
# Screen dimensions
17-
WIDTH, HEIGHT = 800, 600
16+
# Get screen dimensions
17+
info = pygame.display.Info()
18+
WIDTH, HEIGHT = info.current_w, info.current_h
19+
1820
screen = pygame.display.set_mode((WIDTH, HEIGHT))
1921
pygame.display.set_caption("EEG Tug of War Game")
2022

@@ -53,7 +55,7 @@
5355
title_text = "EEG Tug of War Game"
5456

5557
title_surface = font.render(title_text, True, WHITE)
56-
title_rect = title_surface.get_rect(center=(800 // 2, font_size)) # Center at the top middle
58+
title_rect = title_surface.get_rect(center=(WIDTH // 2, font_size)) # Center at the top middle
5759

5860
clock = pygame.time.Clock()
5961

0 commit comments

Comments
 (0)