Skip to main content

Über dieses Buch

Today's Facebook is emerging to become tomorrow's operating system, according to some. Certainly, a WebOS. Web standards-based apps using HTML5, JavaScript, CSS3 and more are now possible on Facebook. Why not get started with developing and selling Facebook game apps on Facebook's App Store?

Beginning Facebook Game Apps Development gets you started with building your first game apps that run on Facebook. Become your own "Zynga" and create your own "Civilization" or "Farmville" and more. Build rich Web-based apps that you can sell on Facebook's App Store.

Because these apps are built on Web standards, you can build and run on many browsers and—more interestingly—more computers, tablets, smartphones and even other devices and appliances that are Web-connected or enabled.



Chapter 1. First Steps

Facebook has emerged over the last several years as the dominant social space. Their astronomical growth has made it


platform for social interaction on the web. Although there have been some hiccups along the way with privacy concerns, Facebook continues to grow and provide a space for users worldwide to interact with one another. Facebook has also introduced a new breed of casual social gaming to the world. Individuals who would never consider themselves gamers are suddenly spending real money to play games such as Farmville, Mafia Wars, War Commander, and SpaLife. The success of companies like Zynga and CrowdStar have made companies including Electronic Arts take notice and start rethinking some of their games for social play.

Wayne Graham

Chapter 2. JavaScript Boot Camp

JavaScript is one of the most predominant languages in use today. There is virtually no website that you can visit these days that does not leverage JavaScript to do anything from improve your experience with the site’s content to recording robust analytics about how you are using the site. JavaScript’s flexibility in allowing developers to choose a style of programming that best fits their style is one of its greatest assets (or, if you are a pessimist, one of its greatest faults), and engineers have put in a lot of work to squeeze every bit of optimization into their JavaScript engines to ensure this code executes as quickly as possible. This chapter introduces you to some of the important JavaScript concepts that we use throughout the rest of the book.

Wayne Graham

Chapter 3. It’s All About Context: Canvas Basics

The emerging HTML5 specification includes facilities for developers to leverage the power of the browser to start to build applications that feel more like native applications. In the past, where you may have written a game in Flash using Adobe’s tools, you now have the ability to do many of the same things inside the browser without needing to download a third-party extension. Because the browser manages the implementation of the specification, developers can also take advantage of the power and memory management the browser provides.

Wayne Graham

Chapter 4. The Plan: Idea to Design

If you are like most developers (myself included), you most likely have opened your favorite editor or IDE and just started developing. You may have had some vague idea of what you wanted your program to do, but you probably just made it up as you went along. Although this can work well for small projects, or learning new techniques, a design-as-you-go approach on a project of a nontrivial size will cause you a lot of headaches. As someone who has started more than one project as an experiment with no plan to grow it into something, I can attest to the fact that you encounter far fewer problems if you spend a little bit of time planning your project out, to understand its scope and anticipate where the hard parts of it will be. This is especially important if you plan to produce an application that is fun and scalable to all the individuals who may install your application on Facebook!

Wayne Graham

Chapter 5. Essential Game Components

In addition to the code you need to develop, you need to spend time developing other components for your game. This chapter introduces some of the basics of constructing those other components. Although a full treatment of building game components would fill a bookshelf, this chapter does touch on some of the tools and techniques used to develop graphic and audio assets.

Wayne Graham

Chapter 6. Your First Game: Alien Turtle Invasion

The time has come to put everything we have gone over in the previous chapters into practice and see how these all work together to work as a game. I follow the development steps I have laid out, including leveraging some open source graphics and sounds to add to the game experience. There is a lot of code in this chapter, but the game only requires your browser, so there is no server setup involved.

Wayne Graham

Chapter 7. Social Components and HTML5 Games

Games are designed to distract us from our daily routines and allow us to engage in a world that would otherwise be impossible. A game that you play with others is, by definition, social. I fondly remember sitting around a table with friends playing board games. I also remember sitting around a living room with friends watching one of them play a game like

Mike Tyson’s Punch-Out!!

Friends that were not actively playing the game would also sit around, either yelling at the players that they were doing it wrong, or engaging in some type of competition for dibs on the next game. I admit here, probably for the first time, these nongaming interactions while gaming were responsible for more than one piece of broken furniture (sorry, Mrs. Jabbar).

Wayne Graham

Chapter 8. Introducing the Facebook Platform

When I first started writing the

Facebook API Developer’s Guide

back in 2007, I was contending with two big issues. First, the documentation for everything was spotty at best. The engineers at Facebook had put up a wiki, which at the time was mostly just an outline naming the different methods available. The real reason for this was the second issue I had to deal with, the application programming interface (API) was changing on an almost weekly basis. In fact, large portions of the example code I wrote for that book had to be scrapped as different pieces of the API were significantly changed, or worse, silently dropped.

Wayne Graham

Chapter 9. Facebook Developer Tools

Now that we have covered the very barest of basics of setting up the infrastructure for a Facebook application, I turn attention in this chapter to leveraging the Facebook platform, with special attention to their developer tools. Developing complex applications for Facebook is perhaps more difficult than other platforms because of all the moving parts. Being able to quickly determine what piece is broken, from your server code that interacts with Facebook’s APIs, to issues with your JavaScript, to issues with the Facebook Platform itself, will go a long way to help you quickly determine what is going on with your application.

Wayne Graham

Chapter 10. Creating Your First Facebook Game

With all the moving parts that compose a game, especially when dealing with a thirdparty platform like Facebook, learning which pieces go where can be a little overwhelming. Hopefully, you now have a good idea of the different components needed for a game and how the individual components work. In this chapter, we will put those together to build and deploy a game to the Facebook platform. I will revisit many of the steps I covered in Chapter 6 when I walked through the development of a simple game, but this time, we will follow some additional steps for deploying to the Facebook platform, as well as using some of the Facebook API calls to add an important game play component.

Wayne Graham

Chapter 11. Adding Facebook Components

In the previous chapter, we walked through using the Facebook Graph API to provide the data for a puzzle game. Now that we have a game people can play, it is time to take it to the next level. We’ll leverage some of the other Facebook APIs to recognize achievements for playing the game and track the fastest times for completing a puzzle. To do this, we need to interact with the Heroku system and its database backend.

Wayne Graham

Chapter 12. Launching Your Game

Once you have finished your game and have tested it on the Facebook Platform, you next need to get people to play the game. This chapter walks you through a cycle that will help you leverage the power of Facebook to gain players for your game.

Wayne Graham

Chapter 13. HTML5 Game Engines

Game development for HTML5 has been progressing rapidly over the last several years. Browsers have come a long way in implementing the HTML 5 canvas specification, as well as optimizing the execution of JavaScript. As browsers have become better with JavaScript, and some really creative developers have put together compelling HTML5 games, frameworks to automate many of the repetitive tasks associated with game development have come onto the scene. These engines take care of loading assets, playing sounds, managing levels, offline storage—virtually all of the moving parts— allowing you to develop modular code and assets that you can (we hope) reuse on different games.

Wayne Graham

Chapter 14. Facebook Fuzed

In the last chapter we took a look at several of the different game engine options available to build HTML5 games. Several of these engines even have Facebook integration already built in! In this final chapter, I take a closer look at one of these engines, work through developing a game with it, and then integrate it into the Facebook platform using the score API. Although all of the engines discussed in the previous chapter make good candidates, I thought it was important to show how using tilesets in games with a good editor can make prototyping and polishing a game a cinch.

Wayne Graham


Weitere Informationen

Premium Partner

Neuer Inhalt

BranchenIndex Online

Die B2B-Firmensuche für Industrie und Wirtschaft: Kostenfrei in Firmenprofilen nach Lieferanten, Herstellern, Dienstleistern und Händlern recherchieren.



Best Practices für die Mitarbeiter-Partizipation in der Produktentwicklung

Unternehmen haben das Innovationspotenzial der eigenen Mitarbeiter auch außerhalb der F&E-Abteilung erkannt. Viele Initiativen zur Partizipation scheitern in der Praxis jedoch häufig. Lesen Sie hier  - basierend auf einer qualitativ-explorativen Expertenstudie - mehr über die wesentlichen Problemfelder der mitarbeiterzentrierten Produktentwicklung und profitieren Sie von konkreten Handlungsempfehlungen aus der Praxis.
Jetzt gratis downloaden!