Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author: Nick Kouvaris
»  Title: Znax
»  Description: Znax is a board game. Click 4 tiles of the same color and form squares as big as you can. You will erase all the tiles inside the square and collect points. Get maximum score if you make a square with game edges.
»  More by: Nick Kouvaris


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4941 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  Author Agence WOP Digital Agency
»  Title: Electricdrum
»  Description: French WOP Agency, 3D websites, Flash (Papervision, Away 3D), event or institutional projects. The agency operates on all digital projects: consulting, design, graphic design, development, online communication. The WOP agency follows you on the implementation of original, creative and optimized digital projects.


Random Links | Add your own Flash Related Links
Flash Tutorials 1481 Tutorials 7 New Tutorials Added!
What's New | Top100

» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» How To Make A Fathers Day Slideshow
» How To Make A Transparent Background of Your Flash File
» Create Flash Banner With Text Disco Light Effect Today we will introduce you a Text Disco Light eff
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Games

Categories The classic game of destroying blocks with a ball.
Author: Oscar Gálvez

 
Page 1
1

(All the actions will be explained at the end of the tutorial)

Here we will learn how to make an arkanoid game in my way. First, we will make the ship then, the ball (remember to make them movie clips and name the ball in the instance). Now we will create a movie clip that will not be seen on the screen, make it the shape that you want and name it “line” in the instance. Make a double click on it an make another movie clip into it. Now, make double click again on the movie clip and write the next on the frame actions:

tellTarget (_root._root.ball) {
 _x -= 10;
 _y -= 10;}

this will make that the ball gets in way to the northwest. Now make another frame and write; gotoAndPlay (1),this will make that the movement repeats constantly. Now make a double click out of the clip and write in the frame actions : stop ();,now make another frame (2nd) and make another movie clip in this second frame into the first movie clip we had already done (not the last one). Make a double click on it an write on the frame actions the next:

 tellTarget (_root._root.ball) {
 _x -= 10;
 _y += 10;}

This will make the ball gets in way to the southwest. Make another frame in this movie clip, an write: gotoAndPlay (1);.make double click out of the movie clip and make another frame (3rd) , then make another movie clip and repeat the same process (rememer to write: stop ();)but in this one you will write:

 tellTarget (_root._root.ball) {
 _x += 10;
 _y -= 10;}

to get northeast position. Repeat the same and in the next frame (4th) you will make the same but in the frame actions of the movie clip you will write:

 tellTarget (_root._root.ball) {
 _x += 10;
 _y += 10;}

to get southeast position. Now make a double click out and write: stop();on the frame actions. Make another double click out to get in the movie. Now we will get into the ship, make double click on it. In there make an invisible movie clip (if you don´t know how to make transparent colours just select the colour you want and make a click on the mixer icon an there write 0% in the alpha) with a rectangle shape and there write the next:

onClipEvent (enterFrame) {
 if (this.hitTest(_root._root.ball)) {
 _root._root.line.gotoAndPlay(2);
 } else {
 }
}

The number of the frame depends on the way you want the ball to go ( the frame number is of the movie clip we were working on) . I recommend to copy this movie clip, paste it next to the other one and to write in the actions another frame number for the ball to get in two different directions.

Now make the walls and write:

onClipEvent (enterFrame) {
 if (this.hitTest(_root.ball)) {
 _root.line.gotoAndPlay(3);
 } else {
 }
}

depending on the frame number of the direction of the ball. Now, we will make the blocks that will be destroyed by the ball.

Make a block with the shape you want, make a double click to enter in the movie clip and write a stop (); in the first frame, make another frame which will have no drawing, and write stop (); again in the frame actions. Now make double click out of the movie clip and write the next actions for the movie clip:

onClipEvent (enterFrame) {
 if (this.hitTest(_root.ball)) {
 _root.line.gotoAndPlay(4);
 gotoAndPlay (2);
 } else {
 }
}

Remember that the frame number of the “line” can be the way you want, but the frame number that appears beneath it cannot be changed because it says that the movie clip will go to its second frame, where it is nothing, this is the frame where it will go when the ball hits the block. Now write the next actions on the ship:

 onClipEvent (keyDown) {
 if (Key.isDown(key.LEFT)) {
 _x -= 7;
 }
}
onClipEvent (keyDown) {
 if (Key.isDown(key.RIGHT)) {
 _x +=7;
 }
}

This will allow you to move the ship. And the number 7 indicates the number of pixels it will advance. Now you can make the ball to go any direction you want and to make the walls that you want and make the game more complex.

This is the explanation some of the actions:

_root.

is a very useful action that means that the movie clip you are referring is out of the movie clip you actually are.

tellTarget (  ) {
}

means that you want another movie clip to make something when you want it.

1

» Level Intermediate

Added: : 2002-05-30
Rating: 3.71 Votes: 197
Hits: 2546
» Author
here is shown how to make the arkanoid game in an easy way.
» Download
Download the files used in this tutorial.
Download (334 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments