Jump to content

Resize platformer like Melon JS


David M
 Share

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

Link to comment
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)

Link to comment
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.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...