Small shaped jigsaw puzzle game producers are introductory courses, in this case, the reader will learn how to make a simple puzzle game in Flash.
First, let us approximate idea of what the game looks like: screen, broken pieces scattered over N images, through the broken picture we can see on the horizon behind a square area, then the right side of the screen was shocked to read in large letters - Simple puzzle.
OK, the idea is completed, we will open the following do it.
First, make tiles
1. Jigsaw puzzles, puzzle did not plan how to do it? Therefore, we must first find out where pictures come, and import it into Flash,.
Select File> Import, import the material to do the puzzle pictures.
2. Just import the pictures selected, select Modify> Transform> Scale, the size of the picture to re-adjust.
3. Photo size adjustment, press Ctrl + B to break up.
4. Select Line tool, draw a cross in the picture, the picture is divided into four. Because this case is to introduce the principle of making puzzles, so here only do four tiles.
We are real common disease that poor 顙?Wong Leng Leng, then stunned, so we then carry out a further processing of the four sides.
5. Press Ctrl + Alt + Shift + R, display the ruler, and then pull it out from the ruler 顙?類?smart straight heron 顚?teach yoga limp line overlap.
6. Press Ctrl + Alt +; locking guide wire. Then hold down the Ctrl key and then use the mouse in the middle of four black line border pulled a turning point?
7. Hold down the Ctrl key again will back the protruding ends, forming a small triangle (Figure 1).
Figure 1
8. Use the mouse to change the small triangle formed small arc (Figure 2).
Figure 2
9. Click to select the top left corner of the piece of picture, press the F8 device Properties dialog box pops up. In the Name of input g1, then Behavior elected Graphic, click OK after the selected picture into a graphic element g1.
Similarly, the rest of the other three images using the same methods are converted into graphic element g2, g3, g4. And then just used to separate the image of the black line to delete.
10. Select g1, g2, g3, g4 four components, press Ctrl + C copy a.
11. Just press Ctrl + V to paste up copy of the component
12. Click to select g1, press F8 Component Properties dialog box pops up. In Name, type b will be chosen Behavior Button, click OK after the selected components into a button component g1 b1.
Similarly, the rest of the other three images using the same method to convert to the button component b2, b3, b4.
13. Click to select b1, press F8 Component Properties dialog box pops up. In Name, type m1, then Behavior selected Movie Clip, click OK after the selected components into a movie clip b1 m1.
Similarly, the rest of the other three images using the same method to convert to movie clip m2, m3, m4.
Thus, the required tiles have been produced. Goes on in the background of the game is to do.
[Next]
Second, make the background
1. The name of the current layer to "tiles." Below the current level and then the new layer named "Background."
2. Check out just copy backup group on the side of the object, press Ctrl + X Cut the.
3. Select the "background" layer, press Ctrl + V, to paste the picture object to this level.
4. Double-click the group to enter edit mode, select all the graphic elements. Press Ctrl + I to open an instance of panel, the Behavior to Movie Clip (Figure 3).
Figure 3
5. Select the top left corner has been turned into Movie Clip of the g1 device instance, in the instance of the Name panel, type d1. Similarly, the remaining three components were named d2, d3, d4.
6. Select all the components, select Window> Panels> Effect, open the effects panel. Select the Tint effect from the list, then Tint Color set to black.
7. Replaced with the text tool, the right side of the stage the book "Simple jigsaw puzzle."
8. Locked "background" layer.
Third, write code
Finally, the highlight of the entire case made, writes the script to make tiles moving.
"Blocks" layer m1 instance, select the components inside the b1. Open the object action panel, enter the following code:
on (press) (
startDrag ("", true); file / / start drag
)
on (release) (
stopDrag ();// stop drag
obj = "/ d1"; file / / floor tiles on the corresponding
if (_droptarget == obj) (file / / determine whether the release of the tiles on the corresponding floor tiles.
file / / if the corresponding tiles on the floor will
file / / release the tiles and their alignment to form an automatic
file / / adsorption effect.
setProperty ("",_ x, getProperty (obj, _x));
setProperty ("",_ y, getProperty (obj, _y));
)
)
2. Double-click the "Blocks" layer m2 instance, select the inside of the b2 component. Open the object action panel, enter the above section of code, and one of the obj = "/ d1"; to obj = "/ d2";.
Similarly, for the rest of the m3, m4 instance, if the phrase obj = "/ d1"; converted into the corresponding obj = "/ d3"; and obj = "/ d4"; can.
Finally, the tiles break up play, the game was on OK (Figure 4).
Figure 4
相关链接:
Archos mkv
ps3 OGM
wmv ps3
video Format
No comments:
Post a Comment