infernojericho
05-08-2005, 07:52 PM
Hi guys, I am a novice on Flash, and I am still have a hard time in getting over it's concepts of frames and stuff.
Anyway, the bad news is that I have a little assignment that is due in a matter of hours and I am stuck in a few parts and I am desperate for help.
My assignment requires me to do a little jigsaw puzzle game.
I have got most parts done, what I'm stuck big time is:
1. The assignment requires me to use a timer, so that if the person can't finish the jigsaw in time it should prompt Game Over or something. I know that I should use the gettimer() function. But I realized that although the timer works (by using a dynamic text) but it does not refresh. What's more is that the timer seems to start counting right on the very moment the flash file has loaded. I only want it to start when the game actually begins.
My code of when clicking on the start game button is:
on (release) {
gotoAndStop(2); //Reveals the frame of Jigsaw Puzzle Pieces
Time = getTimer()/1000;
GameTimer.text = Math.floor(Time);
}
2. Another thing I am stuck with is how to detect whether all the pieces are fully assembled thus ending the game. How the program works is that if the jigsaw piece is placed correctly it will snap firmly (stoping the Drag action). So I was wondering if I wrote something like:
if ((jigsawinstance1.dragStop=true) and..... (jigsawinstance20.dragStop=true)
{ Message.text = "Congradulations"}
Am I on the right track???
Again, I will greatly, greatly appreciate any feedbacks. Thanks again.
Infernojericho
Anyway, the bad news is that I have a little assignment that is due in a matter of hours and I am stuck in a few parts and I am desperate for help.
My assignment requires me to do a little jigsaw puzzle game.
I have got most parts done, what I'm stuck big time is:
1. The assignment requires me to use a timer, so that if the person can't finish the jigsaw in time it should prompt Game Over or something. I know that I should use the gettimer() function. But I realized that although the timer works (by using a dynamic text) but it does not refresh. What's more is that the timer seems to start counting right on the very moment the flash file has loaded. I only want it to start when the game actually begins.
My code of when clicking on the start game button is:
on (release) {
gotoAndStop(2); //Reveals the frame of Jigsaw Puzzle Pieces
Time = getTimer()/1000;
GameTimer.text = Math.floor(Time);
}
2. Another thing I am stuck with is how to detect whether all the pieces are fully assembled thus ending the game. How the program works is that if the jigsaw piece is placed correctly it will snap firmly (stoping the Drag action). So I was wondering if I wrote something like:
if ((jigsawinstance1.dragStop=true) and..... (jigsawinstance20.dragStop=true)
{ Message.text = "Congradulations"}
Am I on the right track???
Again, I will greatly, greatly appreciate any feedbacks. Thanks again.
Infernojericho