Pygame: game resolution change

I’ve been developing a 2D scrolling platform for some time now. This is my first correct game, and it is almost over. I still have not thought about permissions.

My game is tile-based, most fragments and game sprite are .PNG files of 40x40 pixels in size. The default height and width of the screen is 1280x720. As far as I know, most games currently have many resolution options with varying proportions.

I would like to give the player a couple of resolution options, such as 800x600, 1024x768 and 1280x720. This must be done so that the player can see an equal number of tiles in the game, depending on the resolution, so as not to give unfair advantages or disadvantages in using the permission. What will be the best way to achieve this?

I thought about scaling the game sprites in accordance with the given resolution, using

self.image = pygame.transform.scale(self.image, (30, 30))
self.image = pygame.transform.smoothscale(self.image, (30, 30))

This means that sprites are reduced from 30x30 px. being the target sizes. I made them work correctly, but the problem with both is the loss of quality. Less with pygame.transform.smoothscale, but still noticeable enough for my eyes.

It makes me think, is this the best way to get closer to this, really, to create new art attributes from the same files, but with different dimensions? . It seems like a lot of work, especially when you have several permission options. I also thought about creating a default screen resolution by sticking to it and not letting the player choose. But I do not want to do this.

+4
1

, ,

, 576 ! , .

; () 16: 9 (1280x720), ( ) 4: 3 (, 1024x768)? . , , , , "" .

, , (, 800x600) , . , , , !

, ; , , , 40x40 30x30 .

+3

All Articles