I have a scriptlet that allows to add and subtract time from an active timer. It works, but it's for vx ace and now i need it for rmxp. It's only 33 lines, so i hope someone wants to take a look at it. Would help me so much!
There are the script calls:
- #==============================================================================
- # ** Game_Timer
- #------------------------------------------------------------------------------
- # Some more methods
- #==============================================================================
- class Game_Timer
- alias timer_plus_update update
- def update
- if !@pause
- timer_plus_update
- end
- end
- # add more time, in seconds
- def add_time(count)
- @count += count * Graphics.frame_rate
- end
- # subtract time, in seconds
- def lose_time(count)
- @count = [@count - (count * Graphics.frame_rate), 0].max
- end
- def pause
- @pause = true
- end
- def resume
- @pause = false
- end
- end
Expand to see the code.
There are the script calls:
- $game_timer.add_time(20) #add 20 seconds
- $game_timer.lose_time(15) #lose 15 seconds
- $game_timer.pause #pause countdown
- $game_timer.resume #resume countdown
Expand to see the code.