16Fermer18
RazoolaLe 05/02/2017 à 02:20
Apart from the bullet collision optimisations you already mentioned (not checking every frame, taking bullet speed into account), You can also allocate enemy buttets a counter based on how close to your ship the bullet is when it is first drawn and the expected bullet speed. You count down the bullets timer every frame, only after it's hits 0 do you start proper hitbox detection for that bullet. This is helpfull when there are bullets fired in set patterns but its an optimisation not really needed until you see your starting to run out of cycles in a single frame. It would be good pratice to allow for a byte (or word) var for each bullet (or bullet pattern) now in case you need it later.