Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 984 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Measuring time #274863
06/28/09 22:35
06/28/09 22:35
Joined: Aug 2003
Posts: 716
Canada, Toronto
thegamedesigner Offline OP
User
thegamedesigner  Offline OP
User

Joined: Aug 2003
Posts: 716
Canada, Toronto
Hello, I want to flash some stuff in time with my music. It's complex enough I want to tweak it by hand. But my problem is that I can't seem to get an accurate time count.

I had this:

while(1)
{
if(index > 3.75){...}
index += 0.01;
wait(-0.01);
}

But the problem is, getting to 3.75 takes much longer then 3.7 seconds. I think wait is not accurate that small.

Timer() seems like it might be used, but I'm not sure how.

So, how can I measure tenths of a second?

Thanks,
Michael.


My games - www.spyeart.com
Re: Measuring time [Re: thegamedesigner] #274868
06/28/09 22:59
06/28/09 22:59
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
wait can only wait 1 frame,

use
Code:
wait(-3.75);

?

Re: Measuring time [Re: MrGuest] #274876
06/28/09 23:56
06/28/09 23:56
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Or of you need really EVIL accuracy...
Code:
timer();
   while(1)
   {
      if(integer(timer()/1000) > (3.75*1000))  { ... }
      wait(1);
   }




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Measuring time [Re: EvilSOB] #275480
07/01/09 13:37
07/01/09 13:37
Joined: Aug 2003
Posts: 716
Canada, Toronto
thegamedesigner Offline OP
User
thegamedesigner  Offline OP
User

Joined: Aug 2003
Posts: 716
Canada, Toronto
Perfect EvilSOB, that's exactly what I need. Thanks all,

- Michael.


My games - www.spyeart.com

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1