PacktLib: Flash Game Development by Example

Flash Game Development by Example

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Concentration

Defining game design

Setting stage size, frame rate, and background color

Welcome to Concentration ("Hello World")

Creating the tiles

Adding randomness: shuffling the tiles

Placing the tiles on stage

Picking tiles

Checking for matching tiles

Making the player see what happened

Preventing the player from cheating

Fine-tuning the game: adding educational content

Summary

Where to go now

Minesweeper

Defining game design

Creating the empty field

Placing the mines

Adding the digits

Optimization needed

Placing tiles on stage

Showing tile contents

Auto showing adjacent empty tiles

Flagging tiles

Timer and game over

No sudden death

Summary

Where to go now

Connect Four

Defining game design

The game field

Showing smooth animations

Splitting the code

Adding the board

Placing the board to stage

Creating more classes

Placing the disc

Moving the disc

Applying game rules

Checking for possible columns

It's raining discs

Determining a cell value (if any)

Making your move

Waiting for the disc to be added to stage

Checking for victory

Animating discs

The animation itself

Making computer play

Unleashing CPU power

Playing with AI: defensive play

Summary

Where to go now

Snake

Defining game design

Array-based games versus Movie Clip-based games

Preparing the field

Drawing the graphics

Placing the snake

The snake itself

Simplifying the code

Letting the snake move

Controlling the snake

Placing fruits

Eating fruits

Making the snake grow

Placing walls

Making the snake die

Summary

Where to go now

Tetris

Defining game design

Importing classes and declaring first variables

Drawing game field background

Drawing a better game field background

Creating the tetrominoes

Placing your first tetromino

Moving tetrominoes horizontally

Moving tetrominoes down

Managing tetrominoes landing

Managing tetrominoes collisions

Rotating tetrominoes

Removing completed lines

Managing remaining lines

Making tetrominoes fall

Checking for game over

Showing NEXT tetromino

Summary

Where to go now

Astro-PANIC!

Defining game design

Creating the game and drawing the graphics

Adding and controlling the spaceship

Adding a glow filter

Making spaceship fire

Making the bullet fly

Adding enemies

Moving enemies

Being killed by an enemy

Killing an enemy

Killing an enemy—for good

Killing an enemy—with style

Advancing levels

Managing current score and high score

Saving data on your local computer

Bejeweled

Creating documents and objects

Placing the gems

Placing the gems for real

Selecting a gem

Preparing to swap gems

Swapping gems

Swapping gems for real

Selecting which gems to remove

Removing gems

Making gems fall

Adding new gems

Dealing with combos

Giving hints

Summary

Where to go now

Puzzle Bobble

Creating documents and assets

Placing and moving the cannon

Drawing the game field

Drawing the game field with alternate rows

Drawing the game field according to Pythagoras

Loading the cannon with a bubble

Firing the bubble

Letting bubble bounce and stop

Adjusting bubble position and reloading

Allowing bubbles to stack

Detecting bubble chains

Removing the chain

Removing unlinked bubbles

Summary

Where to go now

BallBalance

Creating files and assets

Adding the balance

Choosing where to drop spheres

Dropping the spheres

Stacking spheres

Removing spheres

Adjusting floating spheres

Moving the balance

Summary

Where to go now

Where to Go Now

Index