Major slowdown creating more than 600 particles.

BlitzMax Forums/BlitzMax Beginners Area/Major slowdown creating more than 600 particles.

Amon -

You are moving in the right direction, but there are still some problems. To whoever recommended making sure u have the most up to date OGL drivers - I agree. Made a massive difference on my old PC.

Avoid creating stuff and deleting it each loop - again as someone else said. If you have say falling raindrops and u delete them each time they hit the bottom of the screen and create a new one at the top, this will probs not kill your speed but it is better to recycle. Originally you were recreating and destroying your whole type list each loop which is BAD - but that problem is solved. In your main loop you have a sub loop over all invaders and do an invader.draw(), but invader.draw() loops over all the invaders inside itself - so if you have 3 invaders, you'll draw each of them 3 times! (I think). Try taking the loop out of the drawinvader function (and any others like this). There are further optimisations you can make - let's prove MAX can kick B3Ds ***.