This digest is from computer programming skills and Maintenance phase 8th
First, brief
Flash as a vector graphics and animation software, in the vector graphics compression has an amazing ability to support animation, sound and interaction and many other multimedia design should use the function, and can directly generate the homepage code published on the Web, so soon in the internet world Popular, Today's flash is no longer limited to the production of web animation, it has been successfully infiltrated into music television, advertising, teaching, games and other fields, and as a major development tool to be used.
The use of Flash design games is the highest level of Flash, in Flash, if you want to write a two-D animation game, the need to master VB, C + + and other programming languages, remember those endless functions, absolutely not an easy thing, And Flash will be an organic combination of art design and program development, as long as the full mastery of the use of flash and application techniques, game design concepts and methods, the design of a network game is a breeze.
This paper introduces the process of fighter game design, expounds the design of key technology, makes readers understand the powerful function of flash game design, and grasps the method and skill of flash game design.
the key techniques commonly used in fighter games are:
1, fighter appearance control, including the Fighter button control and launch control, common keyboard key to the top and bottom control, left, right, left, right key combination is a 45-degree angle of control, the space bar for the launch of missile control, launch control of the commonly used fighters bundled missile launch.
2, the appearance of enemy aircraft design, including the number of enemy aircraft, random position, speed design.
3, collision detection design: including whether the aircraft launched a missile to detect the enemy aircraft, whether the enemy aircraft collided with the test, whether the enemy fire hit the aircraft detection.
4, background control: In the fighter game, in order to simulate the feeling of the sky, the background of the stars should move to the left, when the time is longer, the background film clips will move out of the stage, for this reason, should dynamically copy background movie clips, so that players feel the background is continuous.
5, Music control: including the background of dynamic music playback, stop control, fighter launch missiles, hit enemy aircraft, enemy aircraft explosion, attack the sound control of the aircraft.
6, Time and score design: including game limit time design, scoring real-time statistics, life value real-time statistics.
7, Free memory space design: This is a very important part of the design, because the fighter game in the playback process, the dynamic generation of the background, copied the enemy, enemy fire, launched missiles and so on, if not dynamic deletion of these movie clips, occupy more memory space will affect the speed of the game, Some of the development of online games did not pay attention to this aspect, resulting in the player's response to the incident more and more slowly.
8, interface and button design: including the game start interface, failure interface, Victory Interface and button design.
Below, with a W mobile fighter game Design For example, the actual development of the game to explain the process of fighter.
Software development environment: Windows98 above, Flash MX or Flash MX 2004
Steps:
1, into the Flash MX work environment, set the film size for 550*400, background color black, create three scenes, Scene 1 is the beginning of the screen, Scene 2 of the 1th frame is the game process, the 2nd frame is the failure screen, Scene 3 is the Victory screen.
2, in the scene 1 of the 1th frame, import as shown in Figure 1 text, images, buttons, in order to increase the movement of the title text can be made into the text of light changes in the 1th Frame of Action window enter the following code:
function Clean () {
For (i in _root) {
_root[i].removemovieclip ();
}
}
_root.clean ();
Remove all mounted movie clips from this animation, freeing up memory space
Stop ();
Stop, wait for user button to control input code in the Action window of the exit button:
On (release) {
When you release the mouse, quit the game
Fscommand ("Quit", "1");//fscommand statement only works in a standalone player
Enter the code in the Action window of the Start button:
On (release) {
Release mouse into Scene 2, start the game
Nextscene ();
3, enter scene 2, in order to avoid confusion, create 5 layers, named as background animation, up to, enemy, score and background music, failure jump, first make background animation.