@nazimboudeffa Thank you for your kind words about the series! You can ask questions on any channel (yt, forum, twitter, discord) that suits you, I’m trying my best to help out where I can
So I’m not quite sure if I understand the question though. I checked your game and it appears to be scaling fine? But you are saying it has a different aspect ratio and still works, even though I suggested other width & height?
The game size of your Phaser 3 game is not set in stone in any way, apologies if that came across in the video. Your game size must depend on your game requirements, art assets, and especially the target platform. For this series we are creating specifically a mobile game, that is to be played in portrait mode. Now, it just so happens that 360 x 640 works really well for mobile games in portrait mode, because it scales well on a large number of mobile devices! That’s why we are going for this one.
@kiklop133 you are exactly right! The resize function keeps the aspect ratio of the game AND it takes the dpi value of the playing device into consideration. Consequently, there are devices with a screen that has a different aspect ratio than your game and we apply the black borders. Pretty much all movies have been doing this for a long time now also (you get the famous black borders to keep the movie’s aspect ratio on your TV). If you didnt keep the aspect ratio and wanted to fill the whole screen no matter which device, it would stretch the game horizontally or vertically.
There are ways to account for that by resizing the background for example, depending on the device, and posotioning the game elements accordingly. Consequently, a device with higher resolution would see more of the game than one with lower resolution. This can also work well, depending on the game.
@nazimboudeffa Does this help?