矩形与矩形碰撞2
来源:互联网 发布:动漫九宫格锁屏软件 编辑:程序博客网 时间:2024/04/28 01:21
-- local function isCollision( )
-- -- body
-- local x1 = rect1:getPositionX() - rect1:getAnchorPoint().x * rect1:getBoundingBox().width
-- local x2 = rect2:getPositionX() - rect2:getAnchorPoint().x * rect2:getBoundingBox().width
-- local y1 = rect1:getPositionY() - rect1:getAnchorPoint().y * rect1:getBoundingBox().height
-- local y2 = rect2:getPositionY() - rect2:getAnchorPoint().y * rect2:getBoundingBox().height
-- local distance = math.abs(x2 - x1)
-- print("y1 <= y2 + rect2:getBoundingBox().height",y1 <= y2 + rect2:getBoundingBox().height)
-- if distance <= rect1:getBoundingBox().width and y1 <= y2 + rect2:getBoundingBox().height then
-- -- print("碰撞了。")
-- end
-- -- body
-- local x1 = rect1:getPositionX() - rect1:getAnchorPoint().x * rect1:getBoundingBox().width
-- local x2 = rect2:getPositionX() - rect2:getAnchorPoint().x * rect2:getBoundingBox().width
-- local y1 = rect1:getPositionY() - rect1:getAnchorPoint().y * rect1:getBoundingBox().height
-- local y2 = rect2:getPositionY() - rect2:getAnchorPoint().y * rect2:getBoundingBox().height
-- local distance = math.abs(x2 - x1)
-- print("y1 <= y2 + rect2:getBoundingBox().height",y1 <= y2 + rect2:getBoundingBox().height)
-- if distance <= rect1:getBoundingBox().width and y1 <= y2 + rect2:getBoundingBox().height then
-- -- print("碰撞了。")
-- end
0 0
- 矩形与矩形碰撞2
- 圆形与矩形碰撞算法
- 圆与矩形碰撞检测
- 矩形与圆碰撞检测
- 矩形碰撞
- 2个矩形碰撞检测
- 2D游戏中圆形与矩形碰撞检测
- 2D游戏碰撞检测--矩形与圆形
- 2D游戏中圆形与矩形碰撞检测
- 圆与矩形简单碰撞检测
- android 线段与矩形碰撞检测
- 圆与旋转矩形的碰撞检测
- 2D游戏中的碰撞检测:圆形与矩形碰撞检测(Javascript&C++版)
- 2D游戏中的碰撞检测:圆形与矩形碰撞检测(Javascript&C++版)
- 2D游戏中的碰撞检测:圆形与矩形碰撞检测(Javascript&C++版)
- 碰撞检测算法(2D矩形)
- 矩形碰撞检测
- 矩形检测碰撞算法
- 【转】美国互联网电视商Netflix入华 将植入海信电视
- MD5 文件校验之 java 实现
- vyos vpn pptp
- ftp连接unix出现530 Login incorrect错误
- 洛谷 P3390 矩阵快速幂
- 矩形与矩形碰撞2
- Shell常用命令
- [00106]字符串忽略大小写的搜索替换
- 转义字符--Java基础023
- 前端精选文摘:BFC 神奇背后的原理
- 洛谷 P1208 USACO 1.3 混合牛奶 Mixing Milk
- Android App开发从零开始之入门篇(一)—64位Win10系统下安装配置开发环境
- Linux下Python安装MySQLdb以及遇到问题解决办法
- SharedPreferences