View Full Version : Quick Q About While Loop's.

15-06-2004, 07:25 PM
in my lil game im going to need to use a loop for the laser of my ship...now in vb we usually called DoEvents in the loop to allow other things to process while the loop was going eg. ship still have free movement etc.

I want to know does Delphi handle this itself or is there something i can cal similar to Vb's DoEvents?

15-06-2004, 07:35 PM
I don't know Visual Basic very well, but would Application.ProcessMessages fit the bill?

Harry Hunt
15-06-2004, 07:41 PM
don't use a while loop, use a timer!

Since you mentioned lasers and a ship, I assume you're writing an action game of some sort. It's possible to write such a game without using a timer, but it doesn't make much sense.

16-06-2004, 03:43 AM
ive gone off timerz along time ago in vb lol if i need any precise timing i use GetTickCount() API which is what i used in my last vb game to limit certain things.

Its just a run down spac invaders game lol i seem to have a fascniation with a ship shotting laserz at little square looking thing's. ( maybe cause i cant draw for shit :P ).

Harry Hunt
16-06-2004, 07:06 AM
There are very precise thread-driven timers out there...

16-06-2004, 08:55 AM
Im using timerz for this one though jst for randomizing enemy position every so and so and for firing.