Hi everyone.

I’ve programmed a 2D game in Delphi 6 and UnDelphiX. The user would drive a car on a road and will have to kill monsters etc. When the up key is pressed the road and monsters moves down at the same speed and it then appears as if the car is moving up.

I have 2 problems:

I’ve tried to get the movement independent of fps but all the ways I’ve tried results in the movement being jerky. Is there another way?

Code:
dxSpriteEngine1.Move(LagCount);
DXTimer1.Interval := 1000 div 75; This gives 64 fps
Or

Code:
dxtimer1.Interval:=1000 div 70;
NewTime := TimeGetTime;
UpdateSpeed := (NewTime - OldTime) * (OneMSec ) //or * (LagCount/2);  
OldTime := NewTime; 
Y := Y + (0.5 * updatespeed)
I’ve posted about my 2nd problem but got no response, please help:

Code:
constructor TRoad.create(parent:TSprite;imgs:TDXImageList;imgIndex:integer);
begin
  inherited create(parent);
     self.Image:=imgs.Items[ImgIndex];
     self.Width:=self.image.Width;
     self.Height:=self.Image.Height;
     self.PixelCheck:=false;
     self.x:=0;
     self.Y:= form1.DXDraw1.Surface.Height - height; //form1.dxdraw1.height - height; //                                                                             self.engine.surface.height ???????? None of these settings works on other PC???????
     self.Z:=0;
end;
The problem is the self.y line of code. On one pc the setting self.y := -11600 (length of road image) works but not on another pc. Sometimes the road only appears halfway and it should appear at the start.

Hope this clarifies my problems and your feedback will be appreciated. BTW Gr8 site!!!!