Determine the size of the digital (small game) production process

Source: Internet
Author: User
Tags exit insert
Process

Preview the finished product: There are five pairs of unknown number, they have a certain relationship with the number six, if you can judge all right, then you win, if you have more than one judgment error, then you lose.

Download source program


step-by-step instructions:
1) Establish the program as shown in the figure. The 1th frame of the layer background has a border, a decision size button (Btn_arrow), and a text box background (txtback).

2 Insert a key frame at the sixth frame of the layer background, and add "you WIN" in the frame to indicate that you are all right.

Insert a keyframe at frame seventh and delete the words "you WIN" and add "you lose" to indicate that you are wrong.

In the Layer text field, the five text boxes are placed (text field), arranged on top of five text box backs (Txtback), and left to right Set variable name "A1", "A2", "A3", "A4", "A5".

The 1 to 5 frames in the Layer object are divided into five arrows (point) pointing to A1, A2, A3, A4, and A5, and the arrows point to a number that tells the viewer which position to determine.

The Exit button (quit) is placed in the 1th frame of the layer quit and again.

The Exit and Redo buttons (quit and again) are placed in frame fifth.

There is nothing in the layer intialize, just some variables are set in frame 1th. With the mouse double-click Frame 1th, we can see that the A1, A2, A3, A4, A5 are set in the frame with the initial value of "? ", the initial value of I is" 0 ".


  

3 Right click on the left side of the work area of the ">" button, in the pop-up menu select "Properties", that is, enter the Button Property Settings dialog box, switch to the "Action" tab.

On (Press)
Set Variable: "Number" = Random (13) +1
Set Variable: "I" = i + 1
Set Variable: "a" & i = number
If (number >= 7)
Go to Next Frame
Else If (number < 7)
Go to and Stop (7)
End If
End on
The outermost layer of the entire program is "on" (press) ... End If "structure, which means that when the mouse is pressed, the middle statement is executed.
A, 2nd statement indicates that the value of setting the variable "number" is a random number from 1 to 13.
The B, 3rd statement says: Add the value of the current variable "I" to 1.
The C, 4th to 8th statements indicate that when the value of the variable "number" is greater than or equal to 6 o'clock, the program jumps to the next frame, and when the value of "number" is less than 6 o'clock, the program jumps to frame 7th and stops.
4 in the same way, we can look at the actions of the ">" button at the right of the workspace

On (Press)
Set Variable: "Number" = Random (13) +1
Set Variable: "I" = i + 1
Set Variable: "a" & i = number
If (number <= 7)
Go to Next Frame
Else If (number > 7)
Go to and Stop (7)
End If
End on
5 Open the actions of the "Quit" button. This means that when the button is pressed, the movie file is exited.

5 Open the actions of the "Again" button. That means the program beats to frame 1th and plays when the button is released.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.