3. Learning JavaScript

Although the title of the book explicitly calls out SVG, HTML5 Canvas, and WebGL, they wouldn’t be able to do much without the help of JavaScript. SVG, Canvas, and WebGL need JavaScript to drive the interactions between the user and the game. JavaScript also provides the basis for libraries and languages such as GWT and CoffeeScript, which are referenced later in the book. Node.js, also covered later in the book, uses JavaScript to run server-side code. In this chapter, we will cover the basics of JavaScript, along with some useful utilities and libraries that will aid in creating games, and use a JavaScript library to create your first game.

What Is JavaScript?

JavaScript is a loosely typed dynamic language that began ...

Get Learning HTML5 Game Programming: Build Online Games with Canvas, SVG, and WebGL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.