Home > Tutorials > RPG Maker VX > How to create a clock.
How to create a clock.
Clocks are... Clocks.
They will count seconds... Minutes... And hours...
So what? Well, depending in the hour you could make a more realisctic game, for example, it is late? Make the screen look darker, and so!
This tutorial is based on RMVX but could be done with RMXP.
With RMVV...
Make a parallel trigger event...
So that it will be a working clock all the time.
Now, first, at the start of the game, only one time, you create the next variables:
-SEC.
-MIN.
-HOURS.
In the clock event, follow this:
Code:
Wait 60 frames (1 sec).
Increase SEC by 1.
If SEC = 60 then
Increase MIN by 1.
Set SEC to 0.
If MIN = 60 then
Increase HOUR by 1.
Set MIN to 0.
If HOUR is 24 then
Set HOUR to 0.
NOTE: If you using the RMXP a second is 20 frames.
So if you are using the RMXP don't make it wait 60 frames, make it wait 20 frames.
In RMVX is 60 frames.
And you made a clock system.
Remember to place this clock event in all the maps of your game you want the clock to run.
And, if you want to make a day/night system...
Just add other events to change the bright of the screen depending in the hour.
Good luck!
Go to my profile and comment there with suggestions for my tutorials, thank you!
By Omegas7.
Thank you.
|
|
Details
|
|
Tutorial:
|
How to create a clock. |
|
Date Listed:
|
2008-09-01 |
|
Author:
|
Omegas7
|
|
Total Hits:
|
941 |
|
|