Hi,
I’m pulling my hair out!
Can someone please help?
I’m working on a puzzle game.
At present, when all the pieces are put in place it takes you to a specific frame.
However I want to be able to go to 1 of 2 screens depending on the time the puzzle has been completed. I’ve added the code below.
Below I have code for a timer
//if (Hours==0 && Minutes==0 && Seconds==0){
if (Minutes==0 && Seconds==0){
gotoAndPlay(13);
}
else {
if (Seconds>0){
Seconds--;
}
else {
if (Minutes>0) {Minutes--; Seconds=59;}
else {
//Hours--;
Minutes=59;
Seconds=59;
}
}
if (Seconds<10){
// Timer=Hours+":"+Minutes+":0"+Seconds;
Timer=Minutes +":0"+ Seconds;
} else if(Minutes<10){
//Timer=Hours+":0"+Minutes+":"+Seconds;
Timer="0"+ Minutes +":"+ Seconds;
//} else Timer=Hours+":"+Minutes+":"+Seconds;
} else Timer=Minutes+":"+Seconds;
//if (Hours>=0 && Minutes>=0 && Seconds>=0) gotoAndPlay(2);
if (Minutes>=0 && Seconds>=0) gotoAndPlay(2);
var TimerA,sisaMin,sisaSec;
if (Seconds>30){
sisaSec = 90 - Seconds;
sisaMin = 1 - Minutes;
} else if (Seconds<30) {
sisaSec = 30 - Seconds;
sisaMin = 2 - Minutes;
}
if (sisaSec<10){
TimerA=sisaMin +":0"+ sisaSec;
} else if(sisaMin<3){
TimerA="0"+ sisaMin +":"+ sisaSec;
//TimerA=sisaMin +":"+ sisaSec;
} else TimerA=sisaMin+":"+sisaSec;
_root.disp_time_2="Well done, 20 points in " + TimerA + " min:sec.";
}
if (sisaMin==0){
_root.disp_time_2="Awesome, 20 points in less than 1 minute";
}
Below is the code i have for a puzzle piece
on (press) {
startDrag(this, true);
}
on (release) {
stopDrag();
if (this._droptarget == "/box9") {
_root.corSound.start();
_root.count = _root.count+1;
_root.cnt = _root.count;
this._visible = false;
tellTarget ("/box9") {
gotoAndStop("pic");
_alpha = 100;
}
if (_root.count >= 10) {
tellTarget ("/") {
_root.gotoAndStop(4);
zwee111.start();
}
}
} else {
_root.wrSound.start();
}
}
Thanks