Boss Production Tutorial + detailed code explanation + source code

Source: Internet
Author: User
Tags count include touch
Tutorials | source code

See screenshot First:

Click here to download the original file

Everyone good,,,, the first time to write this Dongdong ~ ~ Psychological tension to dig '

We have a lot of flash aircraft games,,, but really like "smart touch" as complete as the few, most of them are not
There is a boss,,, just in a picture of the circulation of enemy aircraft, the interest of the natural reduction of a lot of ...

Recently FLASH8 game section new tutorials are too few, I also write a tutorial, which is a return to the FLASH8 game section:-)

Here I only talk about doing boss's production thought, other protagonist Ah, the Enemy (soldier) does not include the,,, FLASH8 on this aspect of the tutorial should have a lot, we can go to find

Okay, no more nonsense,,, anyway,,, my method is not the best,,, but I hope to give the rookie some encouragement and confidence (including me), and make their own like "smart touch" the same game to:-)

Click to download source files

Everyone good,,,, the first time to write this Dongdong ~ ~ Psychological tension to dig '

We have a lot of flash aircraft games,,, but really like "smart touch" as complete as the few, the majority of the boss is not the,,, just in a picture of the circulation of enemy aircraft, the interest naturally reduced a lot ...

Recently FLASH8 game section new tutorials are too few, I also write a tutorial, which is a return to the FLASH8 game section:-)

Here I only talk about doing boss's production thought, other protagonist Ah, the Enemy (soldier) does not include the,,, FLASH8 on this aspect of the tutorial should have a lot, we can go to find

Well, no more nonsense,,, anyway,,, my method is not the best,,, but I hope to give the rookie some encouragement and letter
Heart (including me), to make their own like "smart touch" the same game to:-)

The principle is actually very simple:
Boss is independent,,, he himself is a separate MC,,, this MC has a lot of frames,,, each frame is its one "behavior",,, such as: To move the protagonist to pull,,,, crazy bullets pull .... Send a super kill attack pull .... The animation of their own death,,,, and then this MC's first,,, is a random function,,, randomly transferred to the boss of the MC inside a,,, then boss will respond to make behavior,,, how?? Is it easy? Then open your Flash 2004, start the formal production bar, hehe

1: The stage of the MC layout:

The main scene altogether is two MC,,,, one is boss's bullet,,, in the scene inside name is called Bosszd,,, another is the boss pulls,,, certainly,,,, it in the scene inside name call it boss!

2:boss the outermost event handler: The code is as follows:

onclipevent (load) {
This._alpha = 0;//just came out with a transparency of 0,,, purpose is to make it appear to have a smooth effect
}
}
Onclipevent (enterframe) {
if (this._alpha<100) {//is said to pull,,, initialization when the boss's alpha is 0,,, when it is less than 100, let him from the far right (outside the scene) to fly in,,, until Alpha 100 of the time stopped.
this._x-= 9;
This._alpha + 5;
}
if (this._x<=354) {
this._x++;
}
if (this._x>=495) {
this._x--;
}///These two words is lets boss limit in the scene right movement,,, if runs to the most left, then the game person's watch lives. Oh:-)
}

3. Randomly move up!!! BOSS!!!
Double-click into the boss of the MC, the first code:

Onclipevent (load) {
This._alpha = 0;//just came out with a transparency of 0,,, purpose is to make it appear to have a smooth effect
}
}
Onclipevent (enterframe) {
if (this._alpha<100) {//is said to pull,,, initialization when the boss's alpha is 0,,, when it is less than 100, let him from the far right (outside the scene) to fly in,,, until Alpha 100 of the time stopped.
this._x-= 9;
This._alpha + 5;
}
if (this._x<=354) {
this._x++;
}
if (this._x>=495) {
this._x--;
}///These two words is lets boss limit in the scene right movement,,, if runs to the most left, then the game person's watch lives. Oh:-)
}

3. Randomly move up!!! BOSS!!!
Double-click into the boss of the MC, the first code:

Onclipevent (load) {
This._alpha = 0;//just came out with a transparency of 0,,, purpose is to make it appear to have a smooth effect
}
}
Onclipevent (enterframe) {
if (this._alpha<100) {//is said to pull,,, initialization when the boss's alpha is 0,,, when it is less than 100, let him from the far right (outside the scene) to fly in,,, until Alpha 100 of the time stopped.
this._x-= 9;
This._alpha + 5;
}
if (this._x<=354) {
this._x++;
}
if (this._x>=495) {
this._x--;
}///These two words is lets boss limit in the scene right movement,,, if runs to the most left, then the game person's watch lives. Oh:-)
}

3. Randomly move up!!! BOSS!!!
Double-click into the boss of the MC, the first code:

Onclipevent (load) {
This._alpha = 0;//just came out with a transparency of 0,,, purpose is to make it appear to have a smooth effect
}
}
Onclipevent (enterframe) {
if (this._alpha<100) {//is said to pull,,, initialization when the boss's alpha is 0,,, when it is less than 100, let him from the far right (outside the scene) to fly in,,, until Alpha 100 of the time stopped.
this._x-= 9;
This._alpha + 5;
}
if (this._x<=354) {
this._x++;
}
if (this._x>=495) {
this._x--;
}///These two words is lets boss limit in the scene right movement,,, if runs to the most left, then the game person's watch lives. Oh:-)
}

3. Randomly move up!!! BOSS!!!
Double-click into the boss of the MC, the first code:

Stop ();
A = random (8) +2;
gotoAndStop (a);
The main is to get a random number, and then jump to this zhen, and thus can randomly out boss of different behavior

Finally starting to launch a bullet pull!!! 2nd code:
In order to image,,, in this, boss is not a still picture,, why? It's firing bullets!!!
I used a very simple circular animation MC to show that he was in the rounds.
The MC event handler for this firing bullet is as follows:

Onclipevent (load) {
Count = 0;//Initializes a behavior persistent timer,,, we call it to control the duration of the current motion (the firing of bullets)
Time = 0;//initialization of the bullet interval timer,,,
}
Onclipevent (enterframe) {
if (_root.plane._y<=110) {
_root.boss._y + 3;
}//let boss at the same time firing bullets,,, in a Y direction of movement,,, so that it is not too stiff
time++;
count++;//since it is a timer,,, He is of course constantly from the pull ... Simulation of the passage of time
if (time>=5) {
Duplicatemovieclip (_ROOT.BOSSZD, "Bosszd" +count, count+11100);
Time = 0;//When the bullet interval timer reaches 5, immediately let him clear 0,,, to reach the circulation of the bullets.
}
if (count>=25) {
_root.boss.gotoandplay (1);
}//Behavior Duration Timer greater than 25,,, let him go to the first one.,,, the next random call behavior
}

With regard to bullets, it is completely independent of the boss,,, that is, he has his own method,,, he is fixed,,, code as follows:

Onclipevent (load) {
if (String (_name)!= "Bosszd") {
this._x = _parent.boss._x-104;
this._y = _parent.boss._y+160;
}
The two sentences is the initial position of the bullets,,, to adjust his position, I this is from the boss of the muzzle out, if you like also can be x,y to set a larger, and let it from the boss butt out can be
}
Onclipevent (enterframe) {
if (String (_name)!= "Bosszd") {
If the name of this instance is not BOSSZD, it executes the function inside the MC itself is not to execute the code,,, plainly it is just a touch version, let the boss to replicate with, the name is copied out of the bosszd+ "bullet Register",,,
This._x-= 10;//boss The motion path of the bullet, both: moving from right to left
if (this._x<=0) {
Removemovieclip (this);//If the bullet goes out of the screen,,, removed ...
}
}
}

All right,,, it's just one of those acts,,, other as long as the behavior of the firing of bullets,,, the idea is the same,,, the other launch of the bullet behavior on the other can be a random launch of different types of bullets,,, such as, divergent bouncing,,, open cotton bullet pull "" "", Big Pull, , and, uh, big hair? So let me tell you something about this behavior.

4. Fast Moan Kill!!! Otherwise you don't deserve to call boss this name!

This looks very abstruse, in fact, if you read the above Dongdong, should not I say you can think of how to do ...
Here I no longer wordy,,, or else to give people to shoot bricks,,,, simple explanation of the idea I do this boss hair when a super big will be whole body a bright,,, screen flash,,, and then a laser,,, all this is actually just a MC,,, I believe we all know how to do this animation,,, Besides, everyone can design their favorite boss Hair super big time action,,, I do not in such a door to get axe pull:-)

The point to note is that the laser is in the process of shooting with a deformation of the animation,,, laser is a kind of bullet

So he's also going to test the collision with the main character,,, so, to add to this laser

if (This.hittest (_root) {_root. Endlife ()}//If you hit the lead, the main character hangs up.

5, extrapolate,,, design belongs to your own boss!!

Here, although I only talk about the boss of the two action, but to extend the action, it is not difficult to,,, nothing more than the frame,,, in these new addition to explain the behavior of the boss,,,, such as the,,, the 3rd frame divergent pinball .... The 4th frame is a flowering bomb .... 5th Frame boss suddenly to the protagonist do suicide test collision pull,,,, more reference to the color Beijing series bar ....
Usually in the last frame plus boss death animation,,, to its hp=0 jump to this,,..

6. The end of ...

So far,,, pretty much the key place has been described,,, it took me nearly two hours to,,, sweat ....
In short, hope you have seen this after some harvest,,, create their favorite boss to!!!

Click to browse the file



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.