0
\$\begingroup\$

I've made a simple multiplayer game, and now trying to make it fit on any screen size. I've tried stretching it out to fit the browser size, but it just appears weird and distorted. I'm also trying to avoid having borders around the edges as it doesn't look particularly nice.

Is there a way to solve this that is fair to all players?

\$\endgroup\$
3
  • \$\begingroup\$ Possible duplicate of Web Game Resolution \$\endgroup\$ – Philipp Nov 16 '18 at 10:15
  • 1
    \$\begingroup\$ How are you stretching your game at present? \$\endgroup\$ – DMGregory Nov 16 '18 at 13:01
  • \$\begingroup\$ The one thing that might distinguish this question from the proposed duplicate is the issue of fairness to the players, but without more details, the question is still too broad. You're familiar with your game, but we're not - how does screen size impact your game mechanics? What specific are you running into? \$\endgroup\$ – Pikalek Nov 17 '18 at 3:00
0
\$\begingroup\$

I usually center the frame in the browser and give it fixed dimensions. If the user's screen is smaller than the dimensions, scale the window proportionally at a set interval until it fits.

For example, if your game is 600px * 400px, and your user has a 500px * 700px display (not realistic), you could set your interval to .25 and scale it down to 450px * 300px, or 75% of its original size. If that doesn't fit, scale it down again (300px * 200px).

This also means everything rendered in the game has to be as well, so keep that in mind.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.