官术网_书友最值得收藏!

Rectangle collision detection

Rectangle collision detection is another fast collision detection method. In many cases, it may be faster than circle collision detection. A rectangle collider is defined by an x and a y coordinate that is the position of the top left corner of our rectangle, as well as a width and a height. Detecting a rectangle collision is pretty straightforward. We look for an overlap on the x axis between the two rectangles. If there is an overlap on the axis, we then look for an overlap on the axis. If we have an overlap on both axes, there is a collision. This technique works pretty well for a lot of old-school video games. Several classic games released on the Nintendo Entertainment System used this method of collision detection. In the game we are writing, we are rotating our sprites, so using traditional non-oriented collision detection will not be useful for us.

主站蜘蛛池模板: 栾城县| 阳新县| 尼玛县| 固安县| 凉城县| 泉州市| 金湖县| 宣武区| 四子王旗| 印江| 海原县| 庄浪县| 易门县| 合肥市| 襄汾县| 兴安县| 东宁县| 托克逊县| 中山市| 乌兰察布市| 香河县| 勃利县| 达孜县| 富蕴县| 兖州市| 谢通门县| 德清县| 洛阳市| 长治市| 肇州县| 苏尼特右旗| 大丰市| 铁岭市| 五峰| 扬中市| 汕尾市| 从化市| 洛扎县| 汉中市| 加查县| 罗江县|