Fetching contributors…
Cannot retrieve contributors at this time
34 lines (27 sloc) 2.64 KB

How to implement a game engine in JavaScript and build a Tron-style game


This tutorial will guide you through the following steps:

  • Step 1 - Creating a server
  • Step 2 - Creating a game engine basis
  • Step 3 - Creating a splash screen using a keyframe animation engine
  • Step 4 - Creating a main menu screen using a font engine
  • Step 5 - Creating a snake and related geometry shapes
  • Step 6 - Creating a complex game screen with multiple layers
  • Step 7 - Bonus! Re-implementing geometry in C++
  • Step 8 - Step 8: What's next?

Make sure you have the following software installed:

  • NodeJS with an ECMAScript 2015 support (v6.0.0 and above).
  • Any web-browser which supports ECMAScript 2015, with a preference for Google Chrome.

The final project is a hybrid of C++ and JavaScript. A JavaScript only version of this tutorial is available here.

This tutorial is mostly based on pure JavaScript, so people can have a deeper understanding of the language and its dynamics. In addition, this tutorial makes a great practice on how to build a nice architecture for complex systems, which can then be expanded and maintained with ease. Yes, it is specifically designed for games, but I truly believe that video games can easily get messed up if not planned and designed properly in terms of object oriented relationships. They are naturally more complicated then any web-app you gonna see out there, so if you can create a game engine and understand its flow, creating a web-app would be a piece of cake for you. By the end of this tutorial, your general sense for programming should be enhanced greatly.

So hopefully that I got you pumped up by now, let's get started!

Begin Tutorial >