Commit 12bca547 authored by spc's avatar spc

modified: src/xiaoxiaole/Robot.ts

parent 63d3e214
...@@ -9,7 +9,7 @@ export class Robot { ...@@ -9,7 +9,7 @@ export class Robot {
this._needWin = needWin this._needWin = needWin
} }
getScore(userScore: number, gameLeftTime: number): number { getScore(userScore: number, gameLeftTime: number, dt: number = 0): number {
if (this._time < 0) { if (this._time < 0) {
this._time = 120 + Math.random() * 60 this._time = 120 + Math.random() * 60
if (this._needWin) { if (this._needWin) {
......
...@@ -1128,6 +1128,9 @@ export class XxlScene extends Scene { ...@@ -1128,6 +1128,9 @@ export class XxlScene extends Scene {
if (this.lt) { if (this.lt) {
let nt = new Date().getTime() let nt = new Date().getTime()
let dt = nt - this.lt let dt = nt - this.lt
if (dt < 0) {
dt = 0
}
this.tt += dt / 1000 >> 0 this.tt += dt / 1000 >> 0
let ntt = config.time - this.tt let ntt = config.time - this.tt
......
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