Monday, June 16, 2014

Simple game in adobe flash or macromedia flash

This tutorial is very simple, first open the program formerly Macromedia Flash usually there are a variety of programs - kind of like the version I use Adobe Flash CS 4. We make it with the documents put on the standard scale flash that is 550 x 400 pixels and wears a white background. Then we create images of birds (for a target shooting). Click on the image and select Modify > Convert to Symbol or press the F8 key, then enter the name of the symbol box appears "bird" and select the type of movie clip.



Then click on the picture of the bird and open the properties box. Select "movie clip" and underneath there is "instance name" and input the instance name: "bird". After that, click on the picture of the bird and actions open the box and enter this code:


onClipEvent(load) { function reset() { if(this._name=="face") { this._visible=false; } else { this._visible=true; } this.dead=0; this.speed=random(4)+3; this._x=600; this._y=random(400); } this.reset(); } onClipEvent(enterFrame) { this._x-=this.speed; if(this._x<-40 data-blogger-escaped-code="" data-blogger-escaped-this.reset="">

Enter the code at the bottom of the layer 1 frame 1 in the actions box:

for(i=1;i<=5;i++) { _root["burung"].duplicateMovieClip("burung"+i,i+1000,burung); }



The next stage we created animations for the dead bird bird clip by clicking and right click select "edit" (Gated to create animations) as the following example:

Then we click on the main fame and enter the following code:

stop();

Now create a second frame by right clicking next to the main frame and select insert frame insert frame and what image you want to create here. And enter the code below in fame to 2:

this.dead=1;

Example:

Then click on the last frame and enter the code below:

this.reset();

Then we create the drawing using a drawing tool cursor. Selection of the cursor image and convert into a movie clip symbol. Click the cursor, open the action panel and typing the following action:

onClipEvent (load) { startDrag(this, true); Mouse.hide(); this.swapDepths(9999); } onClipEvent(mouseDown) { playsounds = new Sound(this); playsounds.attachSound("shot"); playsounds.start(0, 1); for(i=1;i<=5;i++) { if(this.hitTest(_root["face"+i])&&_root["face"+i].dead==0) { _root["face"+i].gotoAndPlay(2); } } }

The last stage try and run the movie, then move the mouse.

No comments:

Post a Comment