Updates‎ > ‎

Diagonal Collision Detection

posted Mar 18, 2010, 10:16 PM by T. J. Chapman
Hello!! Sorry for the delayed response. I'm posting here to ensure you that I am still working on my game. Progress has been slow, but in the past couple of days I have been able to make quite a bit of progress after being stuck for quite some time on my game.

I have been working on diagonal collision detection, and initially I was attempting to use the basic formula y = mx+b (a formula you probably remember from Algebra I) to calculate whether or not a collision had been detected between the rectangular player and the diagonal slopes that I am implementing in the terrain of my game. This process was, quite frankly, not working for me, probably mainly because of my decomposing mathematical knowledge since I took  Calculus II over three years ago... Anyhow, this is not a problem, I have very recently found.

I've found a quicker to implement, easier to understand, and more effecient method for calculating collisions between my shapes. Since each tile, even the diagonal ones, consist of 16x16 pixels, I've simply constructed a constant boolean two-dimensional array that contains a mask for each respective tile's collision -- 1 = solid, 0 = not solid.

Anyhow, I am still working on this, but progress is now being made, and I am not at a stand still like I have been for the past couple of weeks. I'll keep you all posted on any further progress! Hopefully soon I can start working on interesting things -- namely, player movement, gravity, and physics.

- Falcon Five