The Web Game Developer's Cookbook: Using JavaScript and HTML5 to Develop Games [NOOK Book]


Want to start building great web games with HTML5 and JavaScript? Moving from Flash or other game platforms? Already building HTML5 games and want to get better and faster at it? This guide brings together everything you need: expert guidance, sample projects, and working code!

Evan Burchard walks you step-by-step through quickly building 10 popular types of games. Each chapter implements a game within a well-understood genre; introduces a different free, open source, and ...

See more details below
The Web Game Developer's Cookbook: Using JavaScript and HTML5 to Develop Games

Available on NOOK devices and apps  
  • NOOK Devices
  • NOOK HD/HD+ Tablet
  • NOOK
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK Study

Want a NOOK? Explore Now

NOOK Book (eBook)
$17.99 price
(Save 43%)$31.99 List Price


Want to start building great web games with HTML5 and JavaScript? Moving from Flash or other game platforms? Already building HTML5 games and want to get better and faster at it? This guide brings together everything you need: expert guidance, sample projects, and working code!

Evan Burchard walks you step-by-step through quickly building 10 popular types of games. Each chapter implements a game within a well-understood genre; introduces a different free, open source, and easy-to-use HTML5 game engine; and is accompanied with full JavaScript source code listings.

Each game recipe uses tested and well-proven patterns that address the development challenges unique to that genre, and shows how to use existing tools and engines to build complete substantial game projects in just hours. Need a quick JavaScript primer? Evan Burchard provides that, too!

Coverage includes

• Mastering an essential HTML5/JavaScript game development toolset: browser, text editor, terminal, JavaScript console, game engine, and more

• Accelerating development with external libraries and proven patterns

• Managing browser differences between IE, Firefox, and Chrome

• Getting up to speed on web development with a QUIZ game built with JavaScript, HTML, CSS, and JQuery

• Creating INTERACTIVE FICTION “gamebooks” that leverage new CSS3 features and impress.js

• Building PARTY games around the lightweight atom.js engine

• Developing PUZZLE games with the easel.js graphics rendering engine

• Writing PLATFORMERS with melon.js and its integrated tilemap editor

• Coding intense 2-player FIGHTING games for web browsers with game.js

• Building a SPACE SHOOTER with the jQuery-based gameQuery game engine

• Implementing pseudo-3D techniques like ray casting for an FPS (First Person Shooter) style game

• Producing a 16 bit RPG (Role Playing Game) complete with interfaces for dialog, inventories, and turn-based battles with enchant.js

• Building an isometric RTS (Real Time Strategy) game that incorporates server components along with node.js,, and crafty.js

• Engaging players with content that encourages exploration

Turn to The Web Game Developer’s Cookbook for proven, expert answers–and the code you need to implement them. It’s all you need to jumpstart any web game project!

Read More Show Less

Editorial Reviews

From the Publisher

The Web Game Developer’s Cookbook is a fun hands-on introduction both to building games and to web technologies. Learning through making is an empowering, exciting first step.”

Jonathan Beilin

“It is not only a book about libraries: it teaches how web pages work, how games work, and how to put everything together. Study one, learn three: best deal ever.”

Francesco “KesieV” Cottone

Web Alchemist, and Technical Advisor at Vidiemme Consulting

“A wonderful overview of the HTML5 Game Development landscape, covering a wide range of tools and 10 different game genres.”

Pascal Rettig

Author of Professional Mobile HTML5 Game Development

“With a friendly and reassuring tone, Burchard breaks down some of the most well-known gaming genres into their basic ingredients. The Web Game Developer’s Cookbook transforms a seemingly daunting task into an approachable crash course even for those who’ve never written a line of code before.”

Jason Tocci, Ph.D.

Writer, Designer, and Researcher

Read More Show Less

Product Details

  • ISBN-13: 9780133358674
  • Publisher: Pearson Education
  • Publication date: 4/6/2013
  • Series: Game Design
  • Sold by: Barnes & Noble
  • Format: eBook
  • Edition number: 1
  • Pages: 368
  • Sales rank: 861,112
  • File size: 34 MB
  • Note: This product may take a few minutes to download.

Meet the Author

Evan Burchard recognizes that he is not the first or last person driven to learn programming by an interest in creating games, and seeks to empower others to take full advantage of the modern, free, and game-friendly web. In addition to designing games with electricity, ice, fire, and the latest browser technologies, he enjoys extremely long walks (his current record is Massachusetts to Iowa).

Read More Show Less

Table of Contents

Preface xiv

Acknowledgments xv

About the Author xvi

Introduction 1

Audience for This Book 2

Coding Style Conventions Used In This Book 2

How This Book Is Organized 3

How To Use This Book 4

1 Quiz 5

Recipe: Making the Questions 6

Recipe: Hiding and Showing Your Quiz 12

Recipe: Getting Your Questions Back 14

Recipe: The Shopping List 16

Recipe: Which Answers Are Correct? 21

Summary 24

2 Interactive Fiction (Zork, Choose Your Own Adventure Books) 27

Recipe: Styled Pages 28

Recipe: Goto Page 32

Recipe: Adding an Inventory with Drag and Drop 35

Recipe: Adding Complex Interactions 43

Recipe: Breadcrumb Trail 53

Recipe: A Dramatic Ending 56

Summary 58

3 Party (Rock Band, Mario Party) 59

Recipe: Creating a Sample Game in atom.js 60

Recipe: Drawing with Canvas 65

Recipe: Drawing Holes 67

Recipe: Drawing a Mole 70

Recipe: Putting the Moles in the Holes 73

Recipe: Dynamic Mole Peeking 77

Recipe: Bopping Moles 78

Wallowing in Despair with HTML5’s <audio> tag 82

Summary 84

4 Puzzle (Bejeweled) 85

Recipe: Rendering with easel.js 87

Recipe: Rendering More Than One Thing 91

Recipe: Creating Pairs 95

Recipe: Matching and Removing Pairs 97

Recipe: Hiding and Flipping the Pictures 100

Recipe: Winning and Losing 102

Recipe: Caching and Performance 106

Recipe: Matching Pairs Instead of Duplicates 109

Summary 115

5 Platformer (Super Mario Bros, Sonic the Hedgehog) 117

Getting Started with melon.js 118

Recipe: Creating a Tiled Map 118

Recipe: Starting the Game 120

Recipe: Adding a Character 124

Recipe: Building a Collision Map 127

Recipe: Walking and Jumping 128

Recipe: Title Screen 129

Recipe: Adding Collectables 131

Recipe: Enemies 133

Recipe: Powerups 135

Recipe: Losing, Winning, and Information 136

Summary 138

6 Fighting (Street Fighter II) 141

Recipe: Getting Started with game.js 142

Recipe: Accessing Individual Sprites from a Spritesheet 145

Recipe: Handling Input from Two Players 147

Recipe: Moving and Changing Forms 150

Recipe: Nonblocking Input 154

Recipe: Implementing Bitmasks 157

Recipe: Masking Collisions 161

Recipe: Giving and Taking Damage 164

Summary 170

7 Shooter (Gradius) 171

Some Background Info on Rendering 172

Recipe: Getting Started with gameQuery 174

Recipe: Adding “Enemies” 176

Recipe: Making Your Ship 180

Recipe: Enemy Collisions 183

Recipe: Shooting 184

Recipe: Powerups 187

Summary 190

8 FPS (Doom) 193

Recipe: Getting Started with Jaws 194

Recipe: Creating a 2-D Map 196

Recipe: Adding a Player 199

Recipe: Raycasting Top View 203

Recipe: Fake 3D with Raycasting 208

Recipe: Adding a Camera 212

Recipe: Making the World a More Photogenic Place 216

Recipe: Adding a Friend or Foe 221

Summary 229

9 RPG (Final Fantasy) 231

Recipe: Getting Started with enchant.js 232

Recipe: Creating a Map 233

Recipe: Adding the Player 237

Recipe: Adding a Collision Layer 243

Recipe: Status Screen 244

Recipe: Talking to NPCs 248

Recipe: Creating an Inventory 251

Recipe: Creating a Shop 254

Recipe: Creating a Battle Interface 263

Recipe: Saving Your Game with HTML5’s Local Storage API 274

Summary 277

10 RTS (Starcraft) 279

We Need a Server 280

Recipe: Getting Node 282

Recipe: Real Time with 285

Recipe: Creating an Isometric Map with crafty.js 288

Recipe: Drawing the Units 291

Recipe: Moving Units 295

Recipe: Player Specific Control and Visibility 299

Recipe: Collisions for Destruction and Revelation 305

Summary 310

11 Leveling Up 313

What Happened? 314

What’s Next? 314

A JavaScript Basics 317

Main Types of APIs in JavaScript 318

The Native API 318

The Implementation API 318

A Library API 318

Your API 319

Statements 319

Variables 319

Strings 320

Numbers 320

Arrays 321

Functions 321

Objects 322

Conditionals 323

Loops 323

Comments 324

B Quality Control 325

Browser Debugging Tools 326

Testing 328

Collaboration for Better Code 329

C Resources 331

Game Engines 332

Text Editors 333

Browsers 334

Assorted Tools 334

Art Creation/Finding 335

Demos and Tutorials 336

Books 336

Websites 337

Index 339

Read More Show Less

Customer Reviews

Be the first to write a review
( 0 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously

    If you find inappropriate content, please report it to Barnes & Noble
    Why is this product inappropriate?
    Comments (optional)