Interview with Andrzej Mazur - Game Development Using JavaScript

The first in our series of interviews is with Andrzej Mazur, js13kGames competition creator, HTML5 Game Developer, JavaScript Programmer and Mozilla Tech Speaker. He is also the founder of Enclave Games indie studio and publisher of the Gamedev.js Weekly newsletter. In this interview, Andrzej Mazur talks about the perks and benefits of using Javascript on game development.

Web developers and game enthusiasts often fall into the same issue: Can JavaScript be a good programming language for game development? That’s exactly what the JavaScript programmer Andrzej Mazur took into proof when he decided to apply the same skills he used as a web developer to build a Snake style game using jQuery.

Mazur’s first games rapidly became a hit and started to appear on many reviewer’s top lists, and the results of his experiments came faster than he imagined: in 2013, he was able to quit his formal job in a big company to become a full indie developer and founded Enclave Games, a studio that develops quality HTML5 games on demand.

Thereby, Andrzej Mazur is a true believer in the power of JavaScript on games so he decided to took it to the next level: he created js13kGames, a JavaScript competition that allows programmers from all over the world to show their best talent programming a game whose file size limit is set to 13 kilobytes.

The contest happens every year and in 2015 it had a record-breaking of 160 projects submitted. By 2017, more than 120 competitor’s files are expected.

Andrzej Mazur is an HTML5 games developer from Poland and co-founder of Enclave Games

Now, despite web technologies made a huge progress and the idea of creating fun, interactive games that work on any device seems more and more enticing, Mazur reminds that developers have a big challenge on their hands: make better-refined games to stand out in the games industry.

Among asking for advice on the perks and benefits of building HTML5 games, we reached out to Andrzej to get some of the best insights for people who are thinking about creating games using JavaScript. Read the detailed conversation below:

Jscrambler: How did you become an HTML5 game developer?

Andrzej Mazur: I was working as a front-end developer and JavaScript programmer for many years, but deep down I was always fascinated by game development. At some point, I decided to try and see if it was possible to build games with the same web technologies and JavaScript I was already using to build websites.

My first experiments were simple. I created a Snake clone using DOM manipulations with jQuery, and it worked. Making games back then was hard, but not impossible, only a few people tried it at that time. My games became quite popular and ended up in many "top X best HTML5 games" - because the X was actually the number of all the games one could find back then.

After a few years working with front-end development in JavaScript for a couple of big companies, I decided to go full indie and founded Enclave Games with my wife, Ewa. I'm doing quite ok since then.

Hungry Fridge, one of Enclave’s games

Jscrambler: What challenges game developers face when they create a game using JavaScript?

Andrzej Mazur: A few years ago there was plenty of technical problems - sound, performance, working offline, monetization methods, etc. However, now the browsers are fast enough and the major Web APIs implemented to a point where we can confirm the tech stack is ready. That means you don't have to worry about the API itself - it should work out of the box without any errors so you can focus your time and energy on the actual game development.

Yet, as a consequence, it became very easy to build a simple casual HTML5 game. So the competition now is higher and the market is becoming saturated. Hence, your game has to be better, prettier, faster and more polished than your competition to stand out. It is harder to get noticed just by a few games in the portfolio, so you have to add something extra.

Jscrambler: What are some of the advantages and limitations of using this language to create games?

Andrzej Mazur: The strengths and weaknesses of HTML5 games are the same as the web platform itself. On one hand, it might be easier to have your source code stolen than from a native build. This can be avoided by applying a set of powerful obfuscation techniques, anti-debugging or certain locks to the code. You can also face some performance issues compared to the native runtime or have limited access to the hardware. But on the other hand, web games are cross-platform, multi system, and truly multiplatform - you can build once and launch them on basically anything with a browser, even if it is a fridge.

Jscrambler: Is there any specific game style that JavaScript better fits in?

Andrzej Mazur: It still makes more sense to focus on casual, 2D gaming when you want to target older smartphones, but it's entirely up to you. Full-blown 3D games are also an option if you have a good team, enough time and resources. If you try to keep a high frame rate and optimize the performance when needed to have a good experience, then you should be fine.

Jscrambler: In your opinion, what JavaScript game engines can be a great choice?

Andrzej Mazur: For me, the best one is definitely Phaser. It is very popular among other developers I know also. I think it’s the most popular 2D framework for casual games, especially if you want to target mobile, which is a must. Phaser itself is an engine, so you can use its functions and methods and code your way to the final game. If you don't feel like a coder, though, you can test more designer-friendly tools like Construct or Game Maker. I know a few people who haven’t even needed to know programming to make a game with those tools.

There's also some heavyweight tools for native-like experiences such as Unity or Unreal, which can export to the web. But the powerful toolsets usually come with a bloated output, so it's a trade-off you have to consider. Plus, it is more about learning the tools rather than the language.

Jscrambler: What web developers and programmers can do to improve their JavaScript skills to work with games?

Andrzej Mazur: Make more games! Practice building a game, you get better at it with every single one you finish. There isn't a better way to learn something than by doing it. You can also read or watch tutorials, attend workshops, participate in competitions, chat with the community to exchange ideas and experiences... There are many ways to find the knowledge on the Web and outside of it, but it all boils down to practice.

Jscrambler: Is there any community dedicated to JavaScript game developers?

Andrzej Mazur: Yes, there's an active community at the HTML5 Game Devs forums - it's the best place if you want to meet and talk with the developers, showcase your work, ask questions and get solid answers.

If you don't have the time to be up-to-date with every topic, you can subscribe to the Gamedev.js Weekly newsletter and receive the most interesting news, tools and resources from the past week to your inbox every Friday.

Jscrambler: Besides js13kGames, what other competitions should game developers keep an eye on?

Andrzej Mazur: I can recommend trying to participate in a local edition of the Global Game Jam happening at the beginning of the year, or one of the few Ludum Dare competitions. Both are online events but happen to gather developers locally to build games together.

Jscrambler: What JavaScript-based game has caught your attention lately?

Andrzej Mazur: I was recently impressed by the game called Mad World. Looking at the trailer it feels like a next big hit. It is a complex project and it's great to know that everything was built with JavaScript.

This game has a huge potential, and I hope they achieve commercial success. We are still waiting for that one game hit that will burst through to the mainstream, just like Flappy Bird did, and we'll be able to proudly say: “It was made with web technologies, and you can play it on any device you have!”

And this can happen now more than ever. The quality is improving every year, and the advantages of the web itself will make HTML5 games more interesting than native. After all, you don't have to install anything, you can just hit the play button almost instantly right in your browser.

Are you a JavaScript game developer too?

Then you should definitely participate on js13kGames and challenge yourself! You can check out more information about the js13kGames contest and the delivery dates on their official website. You can also check out (and play) some of the HTML5 games Andrzej Mazur developed with his team on Enclave Games’ website.

Have these insights helped you? Then don’t forget to spread them among your friends by using the buttons below.