Book Image

Flash Game Development by Example

By : Emanuele Feronato
Book Image

Flash Game Development by Example

By: Emanuele Feronato

Overview of this book

<p>You can't call yourself a Flash game developer unless you know how to build certain essential games, and can quickly use the skills and techniques that make them up.<br /><br />Flash Game Development by Example is an ultra-fast paced game development course. Learn step-by-step how to build 10 classic games. Each game introduces new game development skills, techniques, and concepts. By the end of the book you will have built ten complete games &ndash; and have the skills you need to design and build your own game ideas.<br /><br />The book starts with simple well known puzzle games: Concentration and Minesweeper. After learning the basics of game design you&rsquo;ll introduce AI with a four-in-a-row game. Then as you build your own versions of old arcade games such as Snake, Tetris, and Astro Panic. The book ends with a collection of modern casual classics.</p>
Table of Contents (17 chapters)
Flash Game Development by Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Where to Go Now
Index

Chapter 1. Concentration

Concentration is a memory game you can play even without a computer, just with a deck of cards. Shuffle the cards, lay them face down on a table and at each turn choose and flip any two cards with faces up.

If they match (both cards are Aces, Twos, Threes, and so on), remove them from the table. If not, lay them face down again and pick another couple of cards. The game is completed when, due to successful matches, all cards have been removed from the table.

Concentration can be played as a solitaire or by any number of players. In this case the winner is the one who removed the most cards.

In this chapter you will create a complete Concentration game from scratch, with a step-by-step approach, learning these basics:

  • Creating a Flash document

  • Working with packages, classes, and functions

  • Printing text

  • Commenting your code

  • Creating and managing variables and constants

  • Creating and managing arrays

  • Generating and rounding random numbers to simulate the shuffle of a deck of cards

  • Repeating the execution of code a given amount of times with the for loop

  • Creating Movie Clips to be added with AS3 and interacting with them on the fly

  • Handling mouse clicks

  • Dealing with timers

It's a lot of stuff, but don't worry as the whole process is easier than you can imagine.