View Single Post
Old 03 June 2018, 21:24   #31
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,214
You could also do a bit of loop unbundling - test all sprites each iteration. It'll save a good amount of jumps and a comparison each time.

Code:
For each bob do
    If (is collision (sprite1) then... 
    Else if (is collision (sprite2) then.. 
   ... 
    Else if (is collision (sprite n) then... 
    End if 
Next
Sprites not in use would need an appropriate flag set to be ignored, but you only have the one loop to contend with.
E-Penguin is offline  
 
Page generated in 0.04723 seconds with 11 queries