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
3 registered members (NnamueN, Akow, 1 invisible), 1,421 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 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 | 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