PDA

View Full Version : Image not loading correctly on different machines... DelphiX



Wizard
02-05-2007, 01:08 PM
Hi everyone. Thanks to Traveller I managed to sort out my sprite movement independant of the timer's frame rate:


NewTime := TimeGetTime;
UpdateSpeed := (NewTime - OldTime) * OneMSec;
OldTime := NewTime;

if (isUp in form1.DXInput1.States) then
y := y + (5 * updatespeed) else
Y := Y + (2 * updatespeed);
if y > form1.DXDraw1.Height then
Dead;

It works smootley and I'm very happy :-)

My question relates to the following:


constructor TRoad.create(parent:TSprite;imgs:TDXImageList;imgI ndex: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:=-11600;
self.Z:=0;
end;
The road image is 11600 in length and is added in the game state machine with:

Road := TRoad.create(dxspriteEngine1.engine,dximageList1,R oadImageIndex);

Problem is that on some PC's the road image is added correctly on my dxForm and on other machines the road image appears on a different y point. I've tried a few things but no success. Any suggestions?