baker
11-28-2007, 03:59 PM
Hi Guys,
Im building a fishing game for one of my uni modules. I got a tutorial off the net. THe proble mis, i have a masked layer with 2 sub layers, one called line, and one called hook.
The code works to extend the fishing line as the down and up keys are pressed, but i cant get the hook to move with it..
onClipEvent (enterFrame) {
if(Key.isDown(Key.DOWN)) {
this._yscale+=100;
_root.hook._y+=8.6;
} if (Key.isDown(Key.UP)) {
this._yscale-=100;
_root.hook._y-=8.6;
} if (this._y < 272) {
this._y = 272;
_root.hook._y = 282;
}
First- what does 8.6 mean in the _root.hook._y+= can someone just translate what this code means and perhaps i can get the hook to link with the line. At the moment only the line moves. Ive followed the tutorial but my axis positions are different....
http://www.tutorialized.com/view/tutorial/Creating-a-fishing-game/8137
cheers
Im building a fishing game for one of my uni modules. I got a tutorial off the net. THe proble mis, i have a masked layer with 2 sub layers, one called line, and one called hook.
The code works to extend the fishing line as the down and up keys are pressed, but i cant get the hook to move with it..
onClipEvent (enterFrame) {
if(Key.isDown(Key.DOWN)) {
this._yscale+=100;
_root.hook._y+=8.6;
} if (Key.isDown(Key.UP)) {
this._yscale-=100;
_root.hook._y-=8.6;
} if (this._y < 272) {
this._y = 272;
_root.hook._y = 282;
}
First- what does 8.6 mean in the _root.hook._y+= can someone just translate what this code means and perhaps i can get the hook to link with the line. At the moment only the line moves. Ive followed the tutorial but my axis positions are different....
http://www.tutorialized.com/view/tutorial/Creating-a-fishing-game/8137
cheers