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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.