Create a Game in JavaScript

Phaser is a JavaScript Game Famework

Building a Game with Phaser

Are you new to game development and don’t know where to begin? That was me about a year ago when I decided that I wanted to make a game. My goal for this was simply to learn more about the JavaScript language and to develop my skills. So let me pass on a little of what I’ve learned so far.

How Modern Games are Built

Back in the early days of video game design, developers would code in every aspect of the game by themselves. This would include all the graphics, physics, audio, etc. Over the years, the game developers began to publish game libraries that other developers could use to help speed up their designs. Why reinvent the wheel?

Today, there are essentially three types of ways that this code is shared:

  • Game Libraries
  • Game Frameworks
  • Game Engines

Game Libraries

Libraries are files that contain reusable code for specific tasks that developers use in their programs. For example, rather than writing a function that calculates the force acted upon two objects in your game, you can use a function that someone else has already created. That way, you don’t have to delve into your High School text book to look up Newton’s Laws and figure out how to calculate this reaction. Someone else already has done the grunt work.

Game Frameworks

A framework is simply a collection of libraries that have a specific function and work nicely together. For example, if Bob wrote a physics library, and Mark wrote a graphics library, how do you know that these two libraries are going to play nicely with one another? You don’t. A game framework will speed up game development and there is often times support and documentation for them.

Game Engines

Game engines are the next step up in the tier. It is even more streamlined for development and offers more API’s for doing your work. The best games today often are developed from Game Engines. As an example, do you remember the game Doom? That revolutionized the gaming industry. The mad scientists who put it together spent years developing it and did things that no one else could figure out how to do. Eventually, they began licensing out their engine to other game studios who would use it to build their own 3rd person shooter.

What is Phaser?

Phaser is a free HTML5 game framework for building games in browsers. It’s built upon JavaScript. With Phaser you can quickly get a new game up and running. It has a lot of support and tutorials to get you started.

Resources

Here is a list of resources for beginning your journey in game development with JavaScript:

Leave a Reply

Your email address will not be published. Required fields are marked *