Saturday, February 25, 2017

Okay, just rearranged collision detection code!

Last post I explained how I got stuck into spaghetti code, and I said I'll try to fix it, and I did.  Now I'll explain what I did

Instead of having the BG collision detection routine do all the sprite movement itself, I can now move sprites outside of the collision routine, just as long as I save the old coordinates before I moved them.  This cut my multijointed boss joint code in half, since I can share a much larger subroutine between non-collision and collision joints.

No comments:

Post a Comment