-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: add fullscreen capability #142
base: release-1.1.0
Are you sure you want to change the base?
Conversation
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.
It's not ok right now.
def fullscreen(): | ||
global WIDTH, HEIGHT, SCREEN, width_temp, height_temp | ||
if bool(SCREEN.get_flags() & pygame.FULLSCREEN): # Check if FULLSCREEN flag is activated | ||
SCREEN = pygame.display.set_mode((width_temp, height_temp)) # Returns window size to original | ||
WIDTH, HEIGHT = width_temp, height_temp | ||
draw_grid() | ||
else: | ||
width_temp, height_temp = WIDTH, HEIGHT | ||
SCREEN = pygame.display.set_mode((0, 0), pygame.FULLSCREEN) # Enables FULLSCREEN flag | ||
WIDTH, HEIGHT = pygame.display.get_surface().get_size() | ||
draw_grid() | ||
|
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.
There is a problem in this function. The way we are placing objects at the screen depends on the WIDTH and HEIGHT. When you die and resets at fullscreen, the game is crashing. It happens when you enter fullscreen and press start too.
Did this feature exist when we froze v1.0.0? |
I think not. |
If was not selected into v1.1.0, it shoukd not enter the release, unless we can vote for new features in the upcoming release. |
I introduce the addition of the fullscreen function, a new feature designed to enhance user experience in the Sucury game. This function enables players to easily toggle between fullscreen and windowed modes, offering a more immersive gaming experience that can adapt to individual player preferences.
The function is integrated to respect the game's original dimensions when switching back from fullscreen to windowed mode. The global variables WIDTH, HEIGHT, and SCREEN are dynamically adjusted to match the current display mode.