Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

1/100 Second & Graphics.update Problem

Status
Not open for further replies.
This time, I'm trying to include 1/100 of a second in Window_PlayTime... you sure know the default time definition there (hours left out):
Code:
@total_sec = Graphics.frame_count / Graphics.frame_rate
min = @total_sec / 60 % 60
sec = @total_sec % 60
Well, I figured that 1/100 seconds should be defined by something like this:
Code:
hsc = @total_sec * 100 % 100

Assuming that this is the correct syntax, I think that I have the problem now that Graphics.update is only run once a second... this is why I want to know how I can modify it to update every... well, 1/100 second, if possible without additional lag... :P Or, of course, if you know another way to display 1/100 seconds via text, throw them in please!

Thanks in advance...
 

arev

Sponsor

First thing - the Graphics.update isn't called once per second but once per frame. Which is 1/40 of second. If you want to call it in that 1/100 s intervals you'll have to increase the frame rate of the whole game (putting "Graphics.frame_rate = 100" in Main) but this would cause events to run much faster (if the PC spec allows it, that is). IMO - it's not worth it :]

Another thing is that I don't think the "hsc = @total_sec * 100 % 100" would return the 1/100s of a second. If your frame rate would be 100, then the 1/100s would simply be "Graphics.frame_count % 100". If you'll decide to stay with 40 fps, multiply the frame_count by 2,5 first.
 
It does indeed update every frame, got that told by Yeyinde earlier ^_^" Well, the method you suggested at last ("hsc = Graphics.frame_count * 2.5 % 100") works just as I imagined it, so thanks for your help, resolved, reported for closing ^_^
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top