With the great interest in mobile games, capable of running on modern portable devices such as smartphones and tablets, there’s a lot of talking about “cross-platform” term these days. Although we are talking about modern devices, the cross-platform concept comes from an older computer age, before smartphones and tablets, probably before any kind of portable device smaller than a mid-sized suitcase. In its original context, cross-platform is an attribute conferred to computer software or computing methods and concepts that are implemented and inter-operate on multiple computer platforms.
Such software and methods are also called “platform independent”. To tell you the short story, a cross-platform software will run on any platform without special adaptation, or with a minimum special adaptation. A good example of a cross-platform language is Java: a compiled Java program runs on all platforms under Java Virtual Machine, which you can find in all major operating systems, including Windows, Mac OS and Linux. Stop with the boring theory and back to our days.
A cross-platform game, the kind of games we are going to build, is a game which will be able to run on various devices, such as smartphones and tablets – but also on desktop machines each one with its own resolution and screen aspect ratio.
Why should I make cross-platform games?
Listen to my story.
When HTML5 mobile gaming started to become popular, I had an iPad2 tablet and made a game which fitted perfectly in its resolution. I was very happy with that game, it was a word game and looked really great on my brand new tablet, covering the entire screen with sprites and colors. Once I completed the game, I started showing it to various sponsors. I already had a list of sponsors emails collected during Flash gaming era, so I was expecting a lot of offers. Actually, I got offers, but most of them said something like “Hey, I like the game, but unfortunately it does not look that good on my iPhone“. “Don’t worry“, I said, “you’ll get the game optimized for both iPad and iPhone“. After some extra work, I was told the game did not look good on the Galaxy Note. A few fixes and tweaks later, it happened the game did not look good on the Samsung S4.
When the game was finally optimized for all required devices, it did not look good anymore on my iPad. You can imagine the rest of this story. I found myself almost rewriting the game with a series of exceptions, trying to make it look good on any device. This is why you should make a cross-platform game: to code once and rule them all. Focus on coding and game development while a framework does the dirty work for you.
That’s when Phaser comes into play.