Recently found an interesting mouse instance, trying to realize it, finding that it is very reference value for things that we do to play games, so you will write the process, I hope to use it for everyone.
Download this source file (Zip compressed file, 468K)
Effect preview: (
Full screen watch
)
Try with a mouse to stand a few slaps or a few feet.
I. Implementing ideas Let's take a look at the effects of the instance, and the mouse is rosked from different places in the scene, and the small people in the scene will have different reactions. Especially interesting is that when the speed of the mouse is different, the strength of the reaction is also different. This is very similar to the implementation in the game. In general, the achievement of the idea is like this: first make the mouse to mark the action effects of different parts, and then use several MOVIE CLIP to capture the position of the mouse, and then play different action effects, This is what we see. Second, let's take a look at the specific implementation process. 1. Press "Ctrl N", create a new Flash file, press "Ctrl F8", create a new MOVIE CLIP, named "All motion". 2. Enter this movie clip, with the right click on the name of the layer, insert "Label", "Action", "Sound", "IDle" four layers, on the "Label" layer first frame attribute panel Set the Label of the frame to "c_idle", click the right mouse button on the 34th frame, insert a keyframe, and set the Label of this frame to "ml_w", the same, in sequence in the 47th frame, 77th frame, 89 frames , 139th frame, 154th frame, 168th frame, second frame, 255 frame, 267th frame, 310 frame, 358 frame, 372 frame, 430 frame, 446 frames, respectively, a keyframe And set the Label of the frame to "ML_S", "MR_W", "MR_S", "TL_M", "TL_W", "TL_S", "TL_M", "TL_S", "TL_M", "TL_S", "TL_M", "B_M", "BL_W", "BL_W "" BL_S "," Br_w "," br_s ". 3. Right-click on the "Action" layer, insert a keyframe, add a statement on this frame on this frame: gotoandPlay (1); Simple, at this layer 46th frame, 75 Frame, 85th frame, 20th frame, 151 frame, 165 frame, 205th frame, 252 frame, 266th frame, 301 frame, 357 frame, 369 frame, 420 frame, 440 frames, The 464th frame is inserted into a keyframe, and add a statement on the ACTION Script panel of the frame: gotoandPlay (1); 4, insert a keyframe on the 34th frame of the "IDLE" layer, in which the layer is first The frame of the frame draws a small person in the drawing tool, as shown in Figure 1. This is displayed when there is no mouse action.
figure 1
5. Insert a keyframe in the 34th frame and the 45th frame of the layer of "Layer1", and produced between the mouse between the 34th frame to the 45th frame, the mouse is passed from the left arm of the small person. Movie Clip effect. In this class, the MOVIE CLIP effect of the mouse is made from the left side of the small person from the 34th frame to the 45th frame. The MOVIE CLIP effect of the mouse is created from the left side of the small man from the 47th frame to the 74th frame. A MOVIE CLIP effect of the mouse is made from the rattles of the small person from the respective arms of the small man from the 34th frame. A MOVIE CLIP effect of the mouse is created between the mouse between the 89th frames to 119 frames. 6. Making the MOVIE Clip effect of the mouse to the left head of the small person from the mouse to the 150th frame. A MOVIE CLIP effect of the mouse is made from the left head of the small person from the small man in the 154th frame to 164 frames. The MOVIE CLIP effect of the mouse is created between the mouse to the left head of the small man from the 688th frame to 204th frame. A MOVIE CLIP effect of the mouse to the right side of the small person is created between the mouse to the 251 frame. A MOVIE CLIP effect of the mouse is created between the mouse to a relatively slow speed between the 255th frame to 265 frames. A MOVIE CLIP effect of the mouse is created between the mouse to the right of the small person from the 5th frame to the 300 frames. 7. Making the MOVIE Clip effect of the mouse with a medium speed from the small man's leg between the mouse to the 356th frame. A MOVIE CLIP effect of the mouse is made from the left leg of the small person from the smart rate between the 358th frame to the 368 frame. The MOVIE CLIP effect of the mouse is created between the mouse to the left leg of the small man from the 372th frame to the 419th frame. A MOVIE CLIP effect of the mouse is made from the right leg of the small man from the small-sized speed of the mouse between the 430th frame to the 439th frame. A MOVIE Clip effect of the mouse is created between the mouse in a faster speed from the 446th frame to the 463th frame. 8, here, the required Movie Clip is completed. The layer structure within the frame should be shown in Figure 2. Note that this is a step of time spending, but also a step on the ultimate effect, it is worth doing. If you want a better effect, you can insert sound effects in the appropriate place. figure 2
9. Press "Ctrl F8" to create a new Movie Clip, with drawing tools in this CLIP. 10. Go back to the main scene of the film, in the right click, click on the layer name, insert 4 layers, name "Action", "Hit_Area", "Motion_all", "Label". 11. Insert a keyframe in the "Motion_all" layer, insert the frame in the 7th frame, drag the MOVIE CLIP made from paragraphs 1 to 8 from the gallery to the scene, set the instance name "motion_all" on the property panel ". 12. Insert a keyframe in the "Hit_Area" layer, insert the frame in the 7th frame, will move the Movie Clip made from step 9 from the gallery to six times to the scene, and a graphic is shown in Figure 3. The instance is set to "Area_Heft_left", "Area_arm_left", "Area_Head_Right", "Area_arm_Right", "Area_arm_Right", "Area_arm_Right", "Area_arm_Right", "Area_LEFT", "Area_lea_Right", "Area_arm_Right", "Area_arm_right", "Area_arm_Right", "Area_arm_Right", "Area_arm_right", "Area_arm_Right", "Area_arm_Right", "Area_arm_Right", "Area_arm_Right", "Area_Arm_Right", "Area_arm_Right", "Area_arm_Right", "Area_arm_right", "Area_arm_right", "Area_arm_right", "Area_arm_Right".
image 3
13. Insert a keyframe in the second frame of the "Action" layer, insert the frame at the 7th frame, at which time the layer in the main scene should be shown in Figure 4. Click on the second frame of the "Action" layer and add a statement under the ACTION Script panel of this frame.
Figure 4
Note 1: Define some variables, which are used to determine whether the mouse is slower, medium, and fast speed. Note 2: Hide the object used to capture mouse action. Note 3: The parameters of the initialized mouse. Note 4: This function is used to capture the speed and the rowed position of the mouse. Note 5: This function is used to determine the speed of the mouse, strong, medium, and weak. Note 6: This function is to determine the position of the mouse, respectively correspond to the head, hand, foot of the object in the scene. Note 7: In this function, play the corresponding scene triggered by the mouse action. Note 8: This is the startup function of the entire scene, the continuous loop, constantly responds to the mouse action. Third, the small knot is generally, it is to let the object in the scene respond to the mouse action, the corresponding mouse action triggers the corresponding MOVIE CLIP. Movie Clip of which make good or bad impact on the overall effect is great and worthy intentions to do a good job Movie Clip Source:. Pconline Author: wings