Quote Originally Posted by notquitehere188
[Highlight=VB] Public Sub Collision()
This is my collision sub, it checks (almost) every collision in my game however it is VERY redundant as you can see but i cant figure out how to shrink it

also note that collide is a function elsewhere in the code for finding if two things are actually touching where the majority of this code is for objects moving over something and finding if and where they should have hit

and if you were wondering, that is the bulletcollideeffects sub
Well the first thing I noticed is that you're using divison a lot with a variable called M. After you setup M, dividie it into 1 one time. After that use multiplication to get you're divison results.

Tx = (B - Ty) * -M
Tbx = (BB - Ty) * -M

You may have to use an extra variable but you'll be trading 8 division instructions for 8 multiplication instuctions. Should give you an instant speedup.