在闪光灯中点击检测as3
嗨,我有一个蛇游戏,使用计时器来增加蛇的大小,并一直试图找出它的命中检测。并且已经到了这个阶段
for (var i = 1; i < snake.length; i++){ //this is where I am trying to make the hit
if (Math.floor(snake[0].x) == Math.floor(s.x) && Math.floor(snake[0].y) == Math.floor(s.y) ){
trace("hit");
}
}
这是怎么回事?谢谢
没有找到相关结果
已邀请:
1 个回复
挂帘妈乡
这是实现您所需要的最简单方法。所以最初把四个简单 sprite作为墙壁,让蛇在它们之间爬行并继续检查“hitTestObject” 四面墙。这条路
见http://ashwani.50webs.com/snake.jpg