Hi everyone, I have the following code to create objects on the form in random order. It works but not the way I expected, if my player bumps into one of the objects a question is generated. Problem is that even though the questions, which are linked to the objects, are generated randomly the same question (object) would sometimes appear 2 or 3 times. How can I make it truly random so that no question (object) appears more than once?

Thanks!

[pascal]const
_RoundCount = 20;

fRoundImageIndex : array[0.._RoundCount-1] of integer;

var LoopLevelOne : integer;
begin
if (Level1Random) then
begin
for loopLevelOne := 1 to _RoundCount do
fRoundImageIndex[loopLevelOne-1]:=formGame.DXImageList.Items.IndexOf('Round'+intTo Str(loopLevelOne));
MyBlock.Add(TBlock.create(265,80,fRoundImageIndex[random(_RoundCount)],DXSpriteEngine.Engine,dxImageList));
MyBlock.Add(TBlock.create(265,200,fRoundImageIndex[random(_RoundCount)],DXSpriteEngine.Engine,dxImageList));
MyBlock.Add(TBlock.create(265,320,fRoundImageIndex[random(_RoundCount)],DXSpriteEngine.Engine,dxImageList));
MyBlock.Add(TBlock.create(7,10,fRoundImageIndex[random(_RoundCount)],DXSpriteEngine.Engine,dxImageList));
end;
end;

initialization
Randomize;
TimeBeginPeriod(1);
end.[/pascal]