真心不明白控制星星速度的部分
這部分什么意思啊啊,求解釋>.<
this.timer += deltaTime;
? ? if( this.timer > 50 ){
? ? ? ? this.picNo += 1;
? ? ? ? this.picNo %= 7;
? ? ? ? this.timer = 0;
? ? }
這部分什么意思啊啊,求解釋>.<
this.timer += deltaTime;
? ? if( this.timer > 50 ){
? ? ? ? this.picNo += 1;
? ? ? ? this.picNo %= 7;
? ? ? ? this.timer = 0;
? ? }
2015-04-17
舉報
2015-04-27
deltaTime是時間差,this.timer是時間差的累加,就是時間過了50以后,this.picNo才加1,這樣速度就慢下來了。