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

feat: add fullscreen capability #142

Open
wants to merge 2 commits into
base: release-1.1.0
Choose a base branch
from

Conversation

SenaJesus
Copy link

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.

@SenaJesus SenaJesus added the enhancement New feature or request label Dec 16, 2023
@SenaJesus SenaJesus added this to the v1.1.0 milestone Dec 16, 2023
@SenaJesus SenaJesus self-assigned this Dec 16, 2023
@SenaJesus SenaJesus linked an issue Dec 16, 2023 that may be closed by this pull request
Copy link
Contributor

@angelobguido angelobguido left a 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.

Comment on lines +360 to +371
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()

Copy link
Contributor

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.

@monacofj
Copy link
Contributor

Did this feature exist when we froze v1.0.0?
I can't remember it.

@angelobguido
Copy link
Contributor

Did this feature exist when we froze v1.0.0? I can't remember it.

I think not.

@monacofj
Copy link
Contributor

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.

@angelobguido angelobguido removed this from the v1.1.0 milestone Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: add fullscreen capability
3 participants