A different slow program
BlitzPlus Forums/BlitzPlus Beginners Area/A different slow program
| ||
If I have the possibility of having a lot of bullets onscreen at once, which would be faster: 1. Testing for each bullet type. If a bullet is created, create it. If a bullet is deleted, nuke it. The usual. 2. Do the above, but if there are too many bullets (above a certain limit), create them but call them something else. Like this: If numberofbullets > bulletlimit bullet2.bullet2 = new bullet2 etc. Else bullet1.bullet1 = new bullet1 Endif I would suspect that the first would be faster because that way you only have to check each of the bullets once, instead of the bullet1 type and then the bullet2 type. Please respond, though. |
| ||
I don't really understand what you are asking. Sorry. Can you explain a bit more? |
| ||
Why do you want to create a new kind of bullet? |
| ||
yeah exactly. If anything you could have a single bullet type and have a field called SubType to define slightly different behaviour. |
| ||
I'm asking if, say, it would be faster to have 100 bullets of the same type, or 20 bullets each of the types bullet1, bullet2, bullet3, bullet4, and bullet5. I can't see any way that the latter could be faster, but my game can have a lot of onscreen bullets... any other suggestions? |
| ||
Sounds like you're interested in a single surface system... |
| ||
the logic of 100 bullets won't slow your game down. Drawing them or doing collision test will, but having more than one type won't affect drawing/collision. However, it's best to avoid >1 type so you can have generic functions to handle them. |
| ||
What's a single surface system, and is there any way to speed the game up? |
| ||
Can someone answer the question I posed above? |
| ||
google "single surface system" blitz. |