Help Files and Tutorials for Computer Users
Tetras

Start by creating a 300400 document in Flash.

In the Property Inspector set the Frame Rate to 24.

 

Fig. 1


Select the Rectangle Tool and draw a square on the stage.

Use the Arrow tool to select the entire square. Set the Shape properties to:

W: 30

H: 30

X:0

Y:0 

 

Fig. 2


Go to Modify --> Convert to Symbol. Select: Movie Clip and give it a Name of "piece". Make sure the registration is set to the top left square.

Fig. 3


Double click on the square you just created to edit it.

Select frame 2.

 

 

 

Fig. 4


Go to Insert --> Timeline --> Keyframe to create a new Keyframe.  Select the square then change the color of the piece.

Fig. 5


Tetris game step 2 Repeat these steps through frame 7, changing the colour in each frame. Your timeline should look like this. Each of the squares should be a different colour.

Fig. 6


Click on frame 1 and go to Window --> Development Panels --> Actions to open the Actions Panel.

Insert the following Actions into the Actions Panel

stop();

Make sure that piece Layer 1:Frame 1 is highlighted in the left window.

 

Fig. 7


Return to Scene 1 by clicking on the Scene1 icon at the top left corner of the screen (above the Timeline).

Select the Line Tool and draw a vertical line in the middle of the stage. (Hold Shift to keep your line straight)

Select the line you drew with the Selection Tool and in the Property Inspector set the following settings:

Width: 0
Height: 400
X: 200
Y: 0

I made my line Red and changed the background color to Black.

Fig. 8


Pick your own colour scheme for your game.

Select the Text Tool and set the Text Type to Static Text.

Click to the right of the line near the top of the stage and type "Level"

Near the middle, to the right of the line, type "Score"

Near the bottom of the stage to the right of the line type "Lines"

 

Fig. 9


Using the Text Tool draw a box below the "Level" text and set the Text Type to Dynamic Text. In the Property Inspector where it says var: put "level".

Using the Text Tool draw a box below the "Score" text and set the Text Type to Dynamic Text

In the Property Inspector where it says var: put "score"

Using the Text Tool draw a box below the "Lines" text and set the Text Type to Dynamic Text

In the Property Inspector where it says var: put "lines"

Fig. 10


Select the Rectangle Tool and draw a rectangle between the left edge of the stage and the line you drew earlier.

Select the Text Tool and make sure in the Property Inspector that the Text Type is set to Static Text. Click on the rectangle you drew and type "Click to start game".

Use the Selection Tool to draw a box around the rectangle and select Modify --> Convert to Symbol from the Manu Bar to convert it to a symbol.

 

 

Fig. 11


Set the Name to "popup" and the type to Movie Clip.

In the Property Inspector set the instance name to "popup"

 

Fig. 12


Double click on the popup movie clip and click on Frame 2. Go to Insert --> Timeline --> Keyframe to add a new keyframe.

Change the text in the rectangle to say Game Over, Click to Restart.

Click on Frame 3 and go to Insert --> Timeline --> Keyframe to add a new keyframe.

 

 

Fig. 13


With the popup still selected ,click on Frame 1 and go to Window --> Development Panels --> Actions to open the Actions Panel.

Insert the following code into the Actions Panel:

stop();

Fig. 14


Return to Scene 1.

Click on Frame 1 and go to Window --> Development Panels --> Actions to open the Actions Panel. 

Insert the following code into the Actions Panel:

Fig. 15


Next Page (Code)


Home