|
|
|
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
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
|
|
|