9781430247166_CO-01.jpg

Chapter 3

Your First Games

This chapter will be your first real look at how to design complete games. They’re short, simple games, but they contain all the elements of game design that you’ll be returning to again and again. Assigning input and output, decision making, keeping score, figuring out whether the player has won or lost, using random numbers, and knowing whether two objects are touching—they’re all here. You’ll also be taking a much closer look at variables and if statements and how to use functions to simplify a big program by breaking it into smaller chunks. By the end of the chapter, you’ll have all the skills necessary to build ...

Get Foundation Game Design with HTML5 and JavaScript 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.