is it possible?
i would like create Q&A game with a countdown-timer.
if timer=0 then stop the game.

how can i do this? Thank you

Recommended Answers

All 9 Replies

Just use a TTimer or please be more specific with your question.

Yes

Sorry...i am the beginner
i don't know what Tobject is.
Can Pascal do this!? i'm not using Delphi.

Program test;
Uses Crt;

procedure timer(d:integer;var t:byte);
Var i:Byte;  {0..255}
Begin
         Dec(t);{decrease value of 'i' by 1}
         Delay(d); {waiting d millisec}

End;

var time:byte;
begin
time:=60;
repeat
 clrscr;
    writeln('Time: ',time );
    timer(1000,time);
until time=0;

end.

Can i use above code add into the game ?

No you would check against real time in game loop, not use delay doing nothing.

oh..i see
have any samples!?
i have not any concept to write.
thank you

Is this solved? The snippet I posted should explain the strategy.

OH....i saw the post.
it is solved.
thank for your help.

Mark then the thread solved from the link at end of thread.

Which post you had seen for solved the question ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.