Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
timer help
12
Years of Service
User Offline
Joined: 14th Jan 2014
Location:
Posted: 10th Feb 2014 19:17
Hi everyone I need help for a timer with MY new game. The timer goes to the negatives and I need it so when it goes to zero it will go to the title screen.

Heres my code:


There are different timers so its hard to put the timer in a code snippet. But thank you for your help.
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 10th Feb 2014 19:43
Which line of your code tells it to go to the title when the timer reaches zero? Are you sure you included such a line?

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 10th Feb 2014 21:32
Quote: " I need help for a timer with MY new game"

Hmmm.... Really? You did that all by yourself? Impressive.



I'll let my young padawan figure out where to place the code into HIS snippet



Oh, and don't forget to define MODE_SCIENCE_TEST at the top with the other constants.

Since you're making a quiz game, thought I might point you to a contest we did a few years ago. Only had two entries, mine and one other, but it was about making a quiz.

timer help
12
Years of Service
User Offline
Joined: 14th Jan 2014
Location:
Posted: 11th Feb 2014 19:18
Quote: "Which line of your code tells it to go to the title when the timer reaches zero? Are you sure you included such a line?"


Yes, I used the code Phaelax gave me and put it in to see if it worked. It did not work and it acted as the code was nothing. Here is the code:



And here is the second part of the code:


Quote: "Hmmm.... Really? You did that all by yourself? Impressive.
"


No I did not make that game, I give you full credit to the game that YOU made the game and I did not.
ShellfishGames
13
Years of Service
User Offline
Joined: 6th Feb 2013
Location:
Posted: 11th Feb 2014 21:46


Are you using two different variables "remainingTime" and "timeLeft" on purpose?

Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Feb 2014 03:08
The original code segment uses timeLeft



So if for some reason you decided to change that variable name to remainingTime, then change my code snippet accordingly.

if remainingTime <= 0 then gosub ResetGame

timer help
12
Years of Service
User Offline
Joined: 14th Jan 2014
Location:
Posted: 12th Feb 2014 18:17
I tried what you did:



And it still didn't work, it acts like the codes not there and basically ignores it.
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Feb 2014 18:51
Not sure what you're doing wrong then, because I just tested this and it works as expected.



Login to post a reply

Server time is: 2026-07-06 10:36:19
Your offset time is: 2026-07-06 10:36:19