主题:  子弹同时射中两个物体

mafeng579

职务:普通成员
等级:1
金币:0.0
发贴:39
注册:2003/3/12 10:55:21
#12003/4/12 9:12:51
x1 = (30 - getProperty(/:heartb, _currentframe)) * 10 - _y;
x2 = (130 - getProperty(/:heartg, _currentframe)) * 2 - _y;
if (Math.abs(x1) <= 25 && Math.abs(x2) <= 25)
{
gotoAndPlay(11);
tellTarget("/:heartx1")
{
gotoAndPlay(random(30) + 31)
}
tellTarget("/:heartx2")
{
gotoAndPlay(1);
}
}

我想了解这段语句.
_currentframe是电影片段实例所播放的帧号 和 Y轴能扯上啥关系呢???
拿30去减后再乘以10再减 _y的坐标值是啥意思???
在if中的取绝对值 <=25 又是什么意思???
我想具体知道_currentframe的属性一般什么情况下用???
(这是一个射击类游戏,当子弹同时射中两个物体才算有效。)



蓝色天空

职务:普通成员
等级:1
金币:0.0
发贴:2
注册:2003/4/10 11:31:30
#22003/4/13 10:19:23
应该是帧号与Y有一一对应的关系,有了帧号就有了Y值。
绝对值<=25应该是判断射中了一个物体。
两个都射中时条件成立。