我的脚本中有2个动作
我已经测试了很多次,当对象到达脚本中设置的x,y坐标时,没有任何反应。有人可以指出问题出在哪里。谢谢
function main()
x1, y1 = findImageFuzzy("/mnt/sdcard/b1.bmp", 90); ---- Find Moving Object
if getColor(368, 653) == 0xBB0011 and x1 == 368 and y1 == 653 then ---- if moving object reach on this x, y coordinate
touchDown(0, 368, 653) ---- shoot
touchUp(0)
elseif getColor(352, 756) == 0xBB0011 and x1 == 352 and y1 == 756 then
touchDown(0, 352, 756)
touchUp(0)
elseif getColor(382, 468) == 0xBB0011 and x1 == 382 and y1 == 468 then
touchDown(0, 382, 468)
touchUp(0)
elseif getColor(361, 551) == 0xBB0011 and x1 == 361 and y1 == 551 then
touchDown(0, 361, 551)
touchUp(0)
elseif getColor(366, 467) == 0xBB0011 and x1 == 366 and y1 == 467 then
touchDown(0, 366, 467)
touchUp(0)
elseif getColor(352, 620) == 0xBB0011 and x1 == 352 and y1 == 620 then
touchDown(0, 352, 620)
touchUp(0)
end
end
我知道问这样愚蠢的问题可能太愚蠢了,但是对于不懂计算机的人,您的帮助将为我带来巨大的进步。
如果球每帧移动一个以上像素,则它可能与任何给定帧上的那些精确坐标都不匹配。代替==
使用<=
或>=
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句