Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crocs that dont stop!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi
I was wondering if anyone could help me with my flash project. I am having a lot of trouble trying to stop animation going onto the next scene.
I have a game in a project I am creating and it is coconuts that you shoot at crocodiles. The problem is that the amimation of the crocodiles wont stop
and they keep going onto the next scene accross the top of everything on the scene. So I have crocodiles going over my next scene...if you get what I mean LOL
Here is my actionscript for the crocodiles which wont stop......is there something I should do because I'm not to good at actionscripting.
Thanks Gabriella


onClipEvent (load) {

function reset(){
this._x=600;
this._y=random(200)+100;
enemySpeed=random(4)+1;
this.gotoAndStop(1);
}

reset();

}

onClipEvent (enterFrame) {

if (_root.spaceship.scrollStart){
this._x-=enemySpeed+_root.mainGround.groundSpeed;
} else {
this._x-=enemySpeed;
}


if (this._x<-10) {
reset();
}


if (this.hitTest( _root.spaceship ) ){
_root.gotoAndStop ( &quot;gameOver&quot; );

}


}
 
The actionScript all looks logical, so it's hard to say where the problem is - can you post a .fla so we can see what it is that's going wrong?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top