Commit 720aaa32 authored by wildfirecode's avatar wildfirecode

Merge branch 'dev' of http://gitlab2.dui88.com/laoqifeng/zeroing-libs into dev

parents deabe0d8 7e6d244d
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -72,11 +72,6 @@ export default class GameView extends engine.Container {
this.onTimer();
}, 10)
}
// this._timeCounter += 0.01;
// this._timeCounter = this.afterPointTwo(this._timeCounter);
// this._timeCounter = Math.floor((this._timeCounter + 0.1) * 10) / 10;
// console.log(this._timeCounter)
onTimer() {
......@@ -84,6 +79,10 @@ export default class GameView extends engine.Container {
// 以GAME_TIME为标准
GAME_TIME -= 0.01
GAME_TIME = this.afterPointTwo(GAME_TIME);
GAME_TIME = GAME_TIME.toFixed(2)
if(GAME_TIME < 10){
GAME_TIME = '0' + GAME_TIME
}
console.log(GAME_TIME);
......@@ -100,22 +99,25 @@ export default class GameView extends engine.Container {
}
afterPointTwo(n) {
var floatN = parseFloat(n);
if (isNaN(floatN)) {
return;
}
floatN = Math.round(floatN * 100) / 100;
return floatN;
}
getSecond() {
return GAME_TIME
// return GAME_TIME - this._timeCounter;
}
stop() {
// this._timeCounter = 0;
GAME_TIME = props.GAME_TIME
clearInterval(this._timer);
}
......@@ -215,8 +217,6 @@ export default class GameView extends engine.Container {
this.index = (this.indexI) * MAX_COL + this.indexJ;
// 图片的中心位置
// this.centerX = e.clientX + w / 2;
// this.centerY = e.clientY + h / 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment