PDA

View Full Version : Any better idea?



Dong Ke
10-30-2001, 04:40 PM
In my pool game, I used a timer object to control the main loop in order to make it possible to rotate the pool with the mouse while the balls GOING on it simultaneously.

It goes something like the following(in Delphi):

procedure form1.OnMouseMove()
begin
update_viewer;
end;

procedure form1.OnTimer1Timer()
begin
if not balls_all_stopped then update_balls;
paint_all_objects;
end;

It works. But it's too slow. Even when I set the interval of the timer to its minimum value 1, the FPS can only reach about 6 f/s or so(on Intel C466, 128M, TNT2 M64 32M). Please show me some more advanced way to make it faster.

Thanx in advance.

[This message has been edited by Dong Ke (edited 10-30-2001).]