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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jigsaw game last piece detection

Status
Not open for further replies.

dannyboy54

Programmer
Sep 19, 2003
1
0
0
GB
Not newbie but limited in action script knowledge

I have made a jigsaw game from scratch and just need a little help in completing it.

below is the script.as file used to control the pieces of the jigsaw:

on (release, releaseOutside) {
if (eval(this._droptarget) == eval("_root."+this._name+"finish")) {
this._x = eval(this._droptarget)._x;
this._y = eval(this._droptarget)._y;
done = true;
}
this.stopDrag();
}
on (press) {
if (done != true) {
this.swapDepths(_root.newDepth);
++_root.newDepth;
this.startDrag();
}
}

what i need to do is detect when the last piece has been put into place so i can make a movie play or make it go to a new frame ect.....

any help would be greatful

thanx loads.
 
Create a variable and set it to 0 at the beginning of the game. When a piece is done, increment the value of the variable by 1, then check that variable against the number of pieces. If both numbers are the same it means all the pieces are done.

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top