4. How Games Work

Trying to define exactly what a game is and isn’t is much more difficult than it seems. Although we may think of games as being purely for competition or entertainment, they actually encompass a lot more. A simulation that determines whether a building is constructed soundly could be thought of a game, as can trying to predict how people will react to certain stimuli. The best all-inclusive definition I could come up with is that a game is a form of interaction with goals and structure. Building upon the lessons we learned about Prototype and its approach to object-oriented programming, we will be using the Prototype-based Simple Game Framework (SGF) to create the games in this chapter. SGF was chosen because the API is complete ...

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.