Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

God Damn Bounding Boxes

Name: DayumBoiyangsh 2012-09-29 13:53

I'm currently making a shitty BREAKOUT clone in Lua and I'm having trouble with collisions. I heard about using bounding boxes but I have no god damn idea what they are or how to use them.

Can someone please explain to me the theory behind bounding box collision?

Been searching Google all day and I ain't getting no answers.

Name: Anonymous 2012-09-29 14:17

If you have a paddle at px, py that is pw pixels wide and ph pixels high, and a ball at bx, by that is bw pixels wide and bh pixels high, then there is a collision when px < bx + bw < px + ph and the same for *y and *h.

Actually that's wrong and it'd take two checks per axis I think I'm too drunk to help you do it yourself.

Name: Anonymous 2012-09-29 14:18


Don't change these.
Name: Email:
Entire Thread Thread List