Hi there
I developing hybrid game. The one game for mobile and desktop.
Mobile has portrait mode only.
Perhaps someone can recommend me a best approach to developing this type of game?
So far, I ran into 2 problems:
- The game should have fixed size due to design. So I try to separate mobile/desktop by this way:
const config = {
width: isMobile()? 585 : 1079
height: isMobile() ? 1266 : 782,
type: Phaser.AUTO,
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH
}
}
That means I must know device platform before game creation.
Any thought how can I detect device outside Phaser scene? I’d tried to find any npm packages, but they are not recommended for use on mobile devices due to poor performance.
2) Another issue is about config separation. I store text and images coordinates as jsons in separate files. This is logical, since, depending on the platform, the coordinates will differ. So I load required config depends on current platform. This is not always convenient. Perhaps someone has a ready-made example of how to properly organize the storage and load of configs? Maybe there is already some ready-made Class?