Interview with Andrzej Mazur - Game Development Using JavaScript

September 8th, 2017 | By Jscrambler | 7 min read

Web developers and game enthusiasts often fall into the same issue: Can JavaScript be a good programming language for game development?

That’s 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.

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 in game development.

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 take it to the next level: he created js13kGames, a JavaScript competition that allows programmers from all over the world to show their best talent in 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 160 projects submitted. By 2017, more than 120 competitor files are expected.

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

Now, despite web technologies making progress and the idea of creating fun, interactive games that work on any device seems more and more enticing, Mazur reminds us that developers have a big challenge on their hands: make better-refined games 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 thinking about creating games using JavaScript. Read the detailed conversation below:

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 of working with front-end development in JavaScript for big companies, I decided to go full indie and founded Enclave Games with my wife, Ewa. I've been doing quite okay since then.

andrzej-mazur_html5-enclave_gamesHungry Fridge is one of Enclave’s games.

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

Andrzej Mazur: A few years ago, there were 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 must add something extra.

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. 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.

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.

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

Andrzej Mazur: For me, the best one is 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 are 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.

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, and chat with the community to exchange ideas and experiences... There are many ways to find knowledge on the Web and outside of it, but it all boils down to practice.

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 in your inbox every Friday.

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.

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 huge potential, and I hope it achieves 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 in js13kGames and challenge yourself!


As a final word, don't forget that the JavaScript and HTML5 of your games are exposed and can be re-distributed by attackers.

Make sure you are protecting it against theft and reverse-engineering by starting your free Jscrambler trial.


The leader in client-side Web security. With Jscrambler, JavaScript applications become self-defensive and capable of detecting and blocking client-side attacks like Magecart.

View All Articles

Must read next


10 Classic Games Recreated in JavaScript

Childhood memories associated with video games can be revived with the help of JavaScript. Fall into nostalgia and find out more!

May 17, 2022 | By Jscrambler | 4 min read


Jscrambler and Js13kGames

Be sure not to miss this year's edition of Js13kGames, a JavaScript coding competition for HTML5 Game Developers.

July 13, 2017 | By Jscrambler | 2 min read

Section Divider

Subscribe to Our Newsletter