Can't really help you with the first question. My first thoughts are vsync, but you mentioned that in your 4th question, so that's probably not it either.
2: something like this
Code:
procedure TForm1.BitBtn1Click(Sender: TObject);
var
Item: TPictureCollectionItem;
picture : TPicture;
begin
picture := TPicture.Create;
picture.LoadFromFile('c:\windows\Zapotec.bmp');
try
Item := TPictureCollectionItem.Create(DXImageList1.Items);
Item.Picture.Graphic := picture.Graphic;
doneLoading := true;
finally
picture.Free;
end;
end;
procedure TForm1.DXTimer1Timer(Sender: TObject; LagCount: Integer);
begin
if doneLoading then
begin
dximagelist1.Items.Items[0].Draw(dxdraw1.Surface,10,10,0);
end;
dxdraw1.Flip;
end;
3: change draw procedure into
Code:
if doneLoading then
begin
dximagelist1.Items.Items[0].StretchDraw(dxdraw1.Surface, rect(10,10,200,200), 0);
end;
4: look into timebased movement, instead of framebased.
5: Easiest way would indeed be to use a global var.
Code:
activeSpriteList[1].X := activeSpriteList[0].X
Hope that helps.
Bookmarks