请高手帮忙解释flash游戏代码 要详细 每一代码一中文

来源:百度知道 编辑:UC知道 时间:2024/09/23 02:35:41
function randRange(minNum:Number, maxNum:Number):Number
{
return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);
}
function updateStats()
{
old_level = level;
level = Math.floor(score / 100);
if (level == 10)
{
gotoAndStop(3);
}
if (level != old_level)
{
var shout:MovieClip = _root.attachMovie("level" + (level - old_level), "level", 4500);
shout._x = 350;
shout._y = 350;
}
stats_txt.text = "Score: " + score + " Level: " + level + " Time:" + myTime;
}

function randRange(minNum:Number, maxNum:Number):Number
//定义函数randRange
{
return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);
//返回(Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum)计算的数值
}
function updateStats()
//定义updateStats函数
{
old_level = level;
level = Math.floor(score / 100);
//对old_level和level进行赋值
if (level == 10)
{
gotoAndStop(3);
}
//如果level为10的话,则跳转到第三帧停止
if (level != old_level)
{
var shout:MovieClip = _root.attachMovie("level" + (level - old_level), "level", 4500);
shout._x = 350;
shout._y = 350;
}
//如果level不等于old_level的话,在主场景放一个由【level" + (level - old_level)】复制过来的实例,取名shout,并且给与坐标
stats_txt.text = "Score: " + score + " Level: " + level + " Time:" + myTime;
//赋予stats_txt文本内容
}