Skip to Content
Supercharged JavaScript Graphics
book

Supercharged JavaScript Graphics

by Raffaele Cecco
July 2011
Intermediate to advanced
278 pages
7h 20m
English
O'Reilly Media, Inc.
Content preview from Supercharged JavaScript Graphics

Chapter 5. Introduction to JavaScript Games

On May 22, 2010, Google released its own version of the retro-classic, dot-chomping game Pac-Man. The game, developed to celebrate Pac-Man’s 30th anniversary, appeared in place of the usual Google logo on the search engine’s home page (Figure 5-1). Many people initially assumed that this fun remake was created with HTML5, but a closer inspection revealed that it used nothing more than regular DHTML (excluding the sound). Continuing with the retro-classic theme, in this chapter we will develop our own DHTML game: Orbit Assault, a variation of the legendary Space Invaders (Figure 5-2).

Pac-Man was a surprise addition to Google’s home page
Figure 5-1. Pac-Man was a surprise addition to Google’s home page
Orbit Assault, an arcade game—DHTML style
Figure 5-2. Orbit Assault, an arcade game—DHTML style

Actually creating an entire game from scratch might seem like heavy going, but it’s the best way to introduce many of the concepts involved in game development.

But why limit ourselves to DHTML? Why not jump straight into using something more powerful, like HTML5 Canvas? Think of it as high-altitude training: if we can create something good with just DHTML, we are equipped to create something even better using Canvas.

Space Invaders was released in 1978 by the Japanese Taito Corporation, and was developed by Tomohiro Nishikado. He not only designed ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Graphics, Games, and Sound with JavaScript

Graphics, Games, and Sound with JavaScript

O'Reilly Media, Inc.
Speaking JavaScript

Speaking JavaScript

Axel Rauschmayer

Publisher Resources

ISBN: 9781449311162Errata Page