Firstly dynamic arrays start at 0 so you should do :
Code:
for I := 0 to numofbullets-1 do
Secondly your answer my lie in your checks - you've got an array of bullets and you're checking to see if a member is nil before you render - perhaps they are nil? please post your code for how you setup the array of bullets so we can check to see if that's a factor.
Thirdly you have a 'picture' property for each bullet - if each bullet has a different image then this is fine but I'm guessing you only have a single bullet texture - it's best to load it once and draw it over and over for each bullet - only storing the unique properties per bullet IE :
Code:
Canvas.Draw(bullets[i].xplace,bullets[i].yplace, FGlobalBulletPicture);
and lastly because dynamic arrays start at 0 you don't need :
Code:
if numofbullets>1 then
(but that should read numofbullets > 0 or numofbullets >= 1) because :
Code:
for I := 0 to numofbullets-1 do
when numofbullets = 0 equates to :
Which will not enter the loop (use 'downto' instead of 'to' if you want to use descending for loops)
Bookmarks