Basic tutorial on making a game of Jigsaw, is compiling the pieces of an image that has been randomized into the picture completely.
We need the Action Script to create this game. If you are still confused with Action Script. Here are a few clues to start learning. You have to know where to put the Action Sript. There are 3 places where the action script was imprisoned, namely Frame Script, Movie Script, and Script Button. Try to find out why the ActionScript was put there and what is its function. Because here is not to be discussed at length.
Step 1: Create a Graphic Symbol "round" like the picture below.
Step 2: Create a Button Symbol "button" that contains symbol "Round"
Step 3: Make a Movie Clip Symbol "dummy" in which you put symbo "button".
Step 4: We will use startdrag function to create objects can be moved around when the mouse in the press (press) and off when mouse button is released (release).
Step 5: Go to a movie clip symbol editors 'Dummy', there is a button symbol "button" that we must give the script. So we put in ButtonScript ActionScript.
You may be confused, why do we have to use movie clips "dummy" why do not directly use the symbol "button" be placed on stage so much easier.
It wants so, but startdrag function can only move the movie clip, not a dummy button so we need to outsmart.
Explanation of script:
When the mouse button on the press "on (press)", startDrag function will make the object follow the mouse cursor wherever go.
When the mouse button off "on (release)", function berhentik stopDrag will make the object follow the mouse cursor.
Step 6: Place the movie clip "dummy" which has been given ButtonScript in it to STAGE. Then run your movie.
Make a Jigsaw Puzzle Game
This is another example of the Flash jigsaw puzzle that I like.
Here is how the technique of cutting an image into part of the jigsaw puzzle:
1) From the Library, take a bitmap image (graphic.jpg) to the stage
2) From the Library, take a movie clip "Jigsaw Overlays" (the contents of the guidelines of each form of puzzles) to the stage at the same layer with the previous image. The position of "Jigsaw Overlay" will be above the image and later will serve as "cookie cutter" for the image below. Make sure the correct size and position. Click on an empty stage to eliminate all selection.
3) Edit> Select All, followed by Modify> Break Apart. So the lines in "Jigsaw Overlay" will be truncated by the image without losing the pixels of the image.
4) Select each section and then make the symbol in a way to Insert> Convert To Symbol that is stored in the Library like a movieclip symbol with a registration point in the middle. Name the symbol of the parts from P1 to P9.
5) Double click somewhere on the line "Jigsaw Overlays" to select all, then delete karen we no longer need these guidelines.
6) Give an instance name for each section as P1target until P9target.
7) Select all parts of the target puzzle, Edit> Copy, then select a higher layer and Edit> Paste ... All this becomes part movieclip real puzzle. You just change the instance name in P1 to P9 P1 so that the puzzles associated with P1target in the lower layer. Do the same for other parts. Spread puzzle pieces randomly on the left side of the stage.
8) Return to layer with all parts of the puzzle and choose their targets again. Set Alpha to 0% they become invisible.
All Action Script is located on the first frame. Will find all the puzzles and give movieclip button behaviors [onPress, onRelease, onReleaseOutside] on them (this feature of Flash MX ... you no longer need separate button-button)
Final message "You're done!" driven by a counter variable piecesLeft ... where the first used to calculate the total number of bagian2 puzzle,
result of the number of object2 in _root (_level0) that have instance names that contain the string "target". Then when the players put the puzzle in the right location, piecesLeft will lose 1 ... time reaches zero, the text "You're done!" appear in dynamic text field _root.message.
One nice feature is able to swap the image that used to puzzle with another image exactly the same size, right click on the image method in the Library, select Properties ...> Import and locate the new image the same size. So without any extra work, you can have a new puzzle, because all the puzzles will keep their orientation is not a problem with what is in the content graphics.
No Response to "Make a Jigsaw Puzzle Game with Flash"
Posting Komentar