Is the right place for drawing objects the FormPaint event? I have put the following piece of code there, but the bullets aren't visible. Only the background and the player's spaceship are visible. What is wrong?
Code:
procedure TMain.FormPaint(Sender: TObject);
var i: integer;
begin
//Canvas.clear;
Canvas.StretchDraw(Rect(0, 0, ClientWidth, ClientHeight), backg);
if numofbullets>1 then
begin
for i:=1 to numofbullets-1 do
begin
if bullets[i]<>nil then
Canvas.Draw(bullets[i].xplace,bullets[i].yplace,bullets[i].picture);
end;
end;
end;
Bookmarks