Placing the disc

Once the board has been created, it's time to draw the discs.

The idea: There are two types of disc, a red one and a yellow one. We will create a Movie Clip symbol with two frames, one for each color of disc and each player.

The development: In connect4.fla, create a new Movie Clip symbol called disc_movieclip and set it as exportable for ActionScript.

Placing the discConnect Fourclasses, creating

Timeline contains:

  • frame 1: a red disc, used by player one (the human)
  • frame 2: a yellow disc, used by player two (the computer)

Both discs have a 60 pixel diameter and registration point at 0,0.

To use them in the game, modify Main.as class level variables this way:

private var gameField:Array; ...

Get Flash Game Development by Example now with O’Reilly online learning.

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