A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11336 Flash Movies | 2 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Surjit Dhami
» Title: Book
» Description: Book
» More by Surjit Dhami


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

Featured Site

» Posted in the Flash Kit Links section
» Title: All-American Rejects
» Description: Get to know this great band by exploring their "practice room".


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

» Create xml slideshow with free template
» How to Insert a Multilingual Subtitle Into Your Flash Video Studio
» How to Create Cool Halloween Slideshow
» Debugging flash using the Firebug console
» Create Flash Slideshow on Blogger
» FLASH TRICKS IN WEB ADVERTISING: FLASH BANNERS
» HTML Photo Gallery Tutorial
» Create your first flash site – PART 1
» How to Make a Flash Photo Gallery
» Unknown Tag: Title10
Random Tutorial | Add Site

Sr Instructional Designer D2L-Moodle,Clearance
WSI Nationwide, Inc.
US-NJ-Fort Monmouth

Justtechjobs.com Post A Job | Post A Resume


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.67 Votes: 193
Hits: 2542
» 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
 
   
 

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs