图片碰撞 [英] picture collision

查看:81
本文介绍了图片碰撞的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,猜猜看,我还有另外一个问题!!


我想要它,以便当image1触及image2时,一个崩溃的消息出现


dosen''t 工作:

展开 | 选择 | Wrap | 行号

解决方案

ohia guys ...不是故意匆匆而是它的任务......所以任何时候很快就会很好


嗯...不太确定我们应该帮助解决这个问题,因为我们有相当严格的反家庭作业政策。但是,一般来说,为了检测两个矩形物体之间的碰撞,我想你可以做这样的事情...


(在这里大声思考)

>
让我们调用方框1 B1X1 / B1Y1和右下方B1X2 / B1Y2的左上角坐标。

对于方框2,调用左上角坐标B2X1 / B2Y1和右下角B2X2 / B2Y2。

展开 | 选择 | Wrap | 行号


$ b $嗯...不太确定我们应该帮助解决这个问题,就像我们一样相当严格的反家庭作业政策。但是,一般来说,为了检测两个矩形物体之间的碰撞,我想你可以做这样的事情...


(在这里大声思考)

>
让我们调用方框1 B1X1 / B1Y1和右下方B1X2 / B1Y2的左上角坐标。

对于方框2,调用左上角坐标B2X1 / B2Y1和右下角B2X2 / B2Y2。

展开 | 选择 | Wrap | 行号


hey guys, guess what, i''ve got another problem for you!!

i want it so that when image1 touches image2, a "crashed message" appears

this dosen''t work:

Expand|Select|Wrap|Line Numbers

解决方案

ohia guys... don''t mean to rush but its an assignment... so any time soon would be nice


Hm... not so sure we should be helping with this, as we have a fairly strict anti-homework policy. However, in general terms, to detect the collision between two rectangular objects I imagine you could do something like this...

(Thinking out loud here)

Let''s call the top-left coordinates of box 1 B1X1 / B1Y1 and the bottom right B1X2 / B1Y2.
For box 2, call the top-left coordinates B2X1 / B2Y1 and the bottom right B2X2 / B2Y2.

Expand|Select|Wrap|Line Numbers


Hm... not so sure we should be helping with this, as we have a fairly strict anti-homework policy. However, in general terms, to detect the collision between two rectangular objects I imagine you could do something like this...

(Thinking out loud here)

Let''s call the top-left coordinates of box 1 B1X1 / B1Y1 and the bottom right B1X2 / B1Y2.
For box 2, call the top-left coordinates B2X1 / B2Y1 and the bottom right B2X2 / B2Y2.

Expand|Select|Wrap|Line Numbers


这篇关于图片碰撞的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆