I worked half the night last night with adding different kinds of collisions. We already have a simple Box vs Box Collision. I moved the code that checked overlap between the boxes from the BoxCollider class to a function in the CollisionManager. I then added a CircleCollision class that holds one X-Y position and a radius.
I also added two functions in the CollisionManager to for check of overlap between circle vs circle and box vs circle. With all in place, I changed the BallObejct so when its created it gets a circle collider instead of a box collider.
I have learned the hard way how sensitive collision is for errors. One varible wrong and you screw up EVERYTHING!!!. I thought i lost it all and was almost about to get back the old code from our backups when i suddenly around 3 o'clock at night kind of solved it?? Don't ask me how but now it kind of works between box vs circle. I have to "fine tune" the code little bit more and then test and try to tune circle vs circle as well.
Oh, I forgot to take screenshots of the strange behaviours.
No comments:
Post a Comment