Flashadvisor logo
:: Desktop Shortcut
:: Flash Help
Advices from Experts

 Submit Here! · Link to Us · Newsletter · Tell a Friend ·

      Add Tutorial |

 

Advertise here










 

Google

Search WWW   
FlashAdvisor.com

 Home > Tutorials  > Gaming

Creating a fishing game using actionscript

Author: imtiazur rahman | Email
Website : www.flashorama.tk


Advertisement

Start Page 4

4.1 Coding:

lets open up the flash MX & make the stage 640X500 pixels. the first layer, we call it "bckgrnd", here we paste the background picture having a river.

layer 2. we name it "fisherman". we paste our fisherman clipart here. this clipart contains a hook with a rope. this rope will go up & down with arrow keys (i hope!)

the next layer, we will name it "fishMask". there will be a mask on the river part of the scene, so that the fishes can only be seen in the river part (it would be absurd if the fishes floated in the land!), here under this layer we put the fishes picture in two layers. in one layer, we put the fish pic. in another layer we put the shark pic.

now time to put some coding. its very easy you will see. in the fish movieClip, we add this code:


onClipEvent (enterFrame) {
this._x = this._x - 10;
if (this._x<0) {
this._x = 640;
}
}


in the shark movieClip, we add this code:


onClipEvent (enterFrame) {
this._x = this._x - 15;
if (this._x<0) {
this._x = 640;
}
}



this code will do nothing but add some motion in the fishbodies so that the fishes float endlessly. thats all to generate motion...easy right?

now we will put some tricky codes okay?

Download Source File

| 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Rate This Tutorial :
We hope the information helped you. If you have any questions or comments, please don't hesitate to post them on the Forums section
Submit your Tutorial at Click Here
  

Home | About Us | Contact Us | Feedback | Advertise with us

Best viewed in 800x600 resolution with Internet Explorer.

Site Developed and Hosted by  ethicsolutions.com
All rights reserved with FlashAdvisor

Flash is a registered trademark of Adobe Systems, Inc.

1 user online