David M

Resize platformer like Melon JS

Recommended Posts

Hi,

First I apologise if this has already been covered but I have searched and searched and not found a clear answer.

In basic terms, I am trying to build a horizontal scrolling platformer that resizes as you change the size of its container. The functionality that I am trying to achieve can be seen in the Melon JS engine and results in no blank bars to the left & right or top & bottom.

Thanks in advance.

David

Share this post


Link to post
Share on other sites

You always have to choose your scaling strategy with regard to game and how you want to present it to player. If game scrolls horizontally, it is usually better to scale it vertically so it fits height and player can see horizontally more or less of level, depending on screen size. For vertical scroller is better to scale to match width and player will see more or less of level vertically.

 If you have single-screen game, that does not scroll, you have to solve scaling in different way. EXACT_FIT may stretch it, which may look ugly. More compex solution is like this: http://sbcgamesdev.blogspot.cz/2015/04/phaser-tutorial-manage-different-screen.html (with special areas to compensate different screen aspects)

Share this post


Link to post
Share on other sites

Hi Tom, I've managed to look through the example you provided and seem to have a working solution, although there are issues with it not always redrawing the level tile graphics when resizing. The width of the game is wider than a single screen but not an endless scroll.

Thanks again for your help.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.