My first attempt at making a game. Stole… uh, I mean, borrowed code from a couple of games I found here and on YouTube, so I’m guessing they are interfering with each other somehow? Trying to count down from 30, but timer resets to 30 after each second. And now I see that since I’m new here, I can’t upload my file to get help.
So, here’s some of the code:
On Default:
gameOver = false;
timer = 0;
maxTime = 60;
On Update:
if (gameOver === false) {
timer+=1;
if(timer>maxTime) {
timer = 0;
maxTime -= 2;
if(maxTime < 20) {
maxTime = 20;
}
On Default:
project.seconds = 1;
project.secondpassed = 30;
On Update:
project.seconds += 1;
if (project.seconds == 60) {
project.secondpassed -= 1;
project.seconds = 0;
}
secondtext.setText(project.secondpassed);