HTML and CSS Reference
In-Depth Information
Chapter 22
Building Nontraditional Games
What's in This Chapter?
• Creating a Twitter application
• Connecting to the Twitter API
• Building a game on the Twitter API Code Downloads for This Chapter
You can find the code downloads for this chapter at
title.cgi?isbn=9781118301326 on the Download Code tab. The code is in the Chapter 22 download and individu-
ally named according to the names throughout the chapter.
HTML5 game developers have the opportunity to take web games out of their customary confines in hard-edged
Adobe Flash boxes and open them up to the rest of the page and the rest of the web. Beyond simple gamification,
HTML5 games have the opportunity to diverge from the standard game genres into other areas and mediums.
One way you can do this is by using other services and websites as the medium on which to play your game. This
chapter uses Twitter, which has a mobile-friendly website and client, as a medium for a collaborative version of
the word-guessing game Hangman .
Creating a Twitter Application
To interact with Twitter, you need to create a Twitter application. In this case you most likely also want to create
a new Twitter account if you already have one to prevent testing the Twitter API and annoying your followers.
You can sign up for a Twitter account and pick a new, unique name at . The game
you build in this chapter is a simple Hangman game. After you complete the signup and confirm your account, go
to: . This is the Twitter developer site where you can find documentation and create Twitter
applications. You need to log in again with the account that you just created.
When logged in, mouse over your account name in the top right and click My Applications. On the applica-
tions page, click Create New Application (see Figure 22-1 ) .
Search WWH ::

Custom Search