Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 13,346 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Level Timer? #325871
05/28/10 19:05
05/28/10 19:05
Joined: Apr 2010
Posts: 47
D
Darkmatters Offline OP
Newbie
Darkmatters  Offline OP
Newbie
D

Joined: Apr 2010
Posts: 47
Hi again... does anyone have any ideas about a level timer??
So the timer starts whehn the level begins, in milliseconds, seconds and minutes..... "00:00:00" sort of thing??

I have looked at timer() and total_ticks, but not sure....

Any help as always is really appreicated...

D.

Re: Level Timer? [Re: Darkmatters] #325874
05/28/10 19:24
05/28/10 19:24
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
total_ticks is what you're looking for i guess.

Re: Level Timer? [Re: Joey] #325878
05/28/10 19:47
05/28/10 19:47
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
var milliseconds, seconds, minutes;

function timer_startup() {
timer();
milliseconds = 0;
while(1) {
milliseconds += (timer() / 1000);
if(milliseconds > 1000) {
milliseconds -= 1000;
seconds += 1;
}
if(seconds > 59) {
minutes += 1;
seconds -= 60;
}
wait (1);
}
}


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Level Timer? [Re: Superku] #325897
05/28/10 20:34
05/28/10 20:34
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
won't work if he's using timer() anywhere else.

Re: Level Timer? [Re: Darkmatters] #325902
05/28/10 20:44
05/28/10 20:44
Joined: Apr 2010
Posts: 172
W
wdlmaster Offline
Member
wdlmaster  Offline
Member
W

Joined: Apr 2010
Posts: 172
use total_ticks instead:
Code:
var count,ms,sc,mn = 0;

function count_up() {
	var start = total_ticks;
	while (1) {

	count = (total_ticks - start) / 16 * 1000;
	ms = integer(cycle (count,0,1000));
	sc = integer(cycle (count / 1000,0,60));
	mn = integer(cycle (count / 60000,0,60));

	wait(1);}}



Re: Level Timer? [Re: wdlmaster] #325905
05/28/10 21:08
05/28/10 21:08
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
@Joey: You're right, I'm sorry.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | 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