FLASH IF 的用法

来源:百度知道 编辑:UC知道 时间:2024/05/24 03:09:07
if(!started) {
start_time=getTimer();
started=true;
timer=0;
i=o;
munite=0;
}
为什么要写第一句?有什么用啊?

第一句是在判定,你的这个东西是否已经开始了。已经开始了,当然就不能再运行下面的代码了,否则又完全从零开始了。
“!started”是started的值取反的意思,已经开始后,“started”为真,“!started”自然为假咯,为假就进不去下面的代码了。