Add seconds to the timer

Status
Not open for further replies.

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,579
Reaction score
10,916
First Language
English
Primarily Uses
RMVXA
Normally when the timer is used to set a limit to how long the player has to complete something, it starts at the given length and counts down to zero, at which point the player has run out of time.

However, what I would like to be able to do is to provide something which will extend the length of time available by adding X number seconds back on to the timer. So, for example, the player hits a switch which adds 20 seconds on to the time still available.

How would I go about doing that?

Thanks.
 

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,579
Reaction score
10,916
First Language
English
Primarily Uses
RMVXA
That does indeed look like exactly what's needed.
Thank you very much.
 

Rinobi

Veteran
Veteran
Joined
Mar 24, 2014
Messages
570
Reaction score
217
First Language
English
Primarily Uses
RMVXA
Can also be done with a script call.
Code:
$game_timer.start($game_timer.sec * 60 + 1200)
You'll need to convert seconds to frames by multiplying by 60. The above adds 20 seconds to the timer.
 
  • Like
Reactions: Kes

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,579
Reaction score
10,916
First Language
English
Primarily Uses
RMVXA
@Rinobi Even nicer, as it means I don't have to have a whole script just for one function (though I'll keep that script in mind for another project.)
Thank you.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

What if I took a lesson from Half Minute Hero? Let the player get dumb powerful each area, but reset them down to just slightly stronger than before for the next map?
Been averaging 2-3 hours sleep for almost a month now. Starting to space out all the time ^^;
loopk wrote on whtdragon's profile.
Nice to meet you. My name is loopk.
May I use the materials distributed here for adult games for sale?

Thank you in advance.
loopk wrote on Avery's profile.
Nice to meet you. My name is loopk.
May I use the materials distributed here for adult games for sale?

Thank you in advance.
tfw, after your game being intensively played by many people, after 5 years, patch after patch released, suddenly an innocent person reported another bug.

Forum statistics

Threads
94,256
Messages
919,443
Members
123,971
Latest member
TsuruharaYuki
Top