|
|
@ -23,24 +23,32 @@ class GameMap extends AcGameObject { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div>`)); |
|
|
|
</div>`)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.root.$kof.append($(` |
|
|
|
|
|
|
|
<audio id="player" autoplay> |
|
|
|
|
|
|
|
<source src="./static/audios/bgm.m4a" type="audio/mpeg"> |
|
|
|
|
|
|
|
</audio>`)); |
|
|
|
|
|
|
|
|
|
|
|
this.time_left = 60000; // 剩余时间
|
|
|
|
this.time_left = 60000; // 剩余时间
|
|
|
|
this.$timer = this.root.$kof.find('.kof-head-timer'); |
|
|
|
this.$timer = this.root.$kof.find('.kof-head-timer'); |
|
|
|
|
|
|
|
this.$bgm = this.root.$kof.find('#player')[0]; |
|
|
|
|
|
|
|
this.$bgm.currentTime = 0; |
|
|
|
|
|
|
|
this.$bgm.play(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
start() { |
|
|
|
start() { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
update_timer() { // 更新时间
|
|
|
|
update_timer() { // 更新时间
|
|
|
|
let [a, b] = this.root.players; |
|
|
|
let [a, b] = this.root.players; |
|
|
|
if (a.status === 6 || b.status === 6) { |
|
|
|
if (a.status === 6 || b.status === 6) { |
|
|
|
|
|
|
|
this.$bgm.pause(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.time_left -= this.time_delta; |
|
|
|
this.time_left -= this.time_delta; |
|
|
|
if (this.time_left < 0) { |
|
|
|
if (this.time_left < 0) { |
|
|
|
this.time_left = 0; |
|
|
|
this.time_left = 0; |
|
|
|
|
|
|
|
this.$bgm.pause(); |
|
|
|
if (a.status !== 6 && b.status !== 6) { |
|
|
|
if (a.status !== 6 && b.status !== 6) { |
|
|
|
a.status = b.status = 6; |
|
|
|
a.status = b.status = 6; |
|
|
|
a.current_frame_cnt = b.current_frame_cnt = 0; |
|
|
|
a.current_frame_cnt = b.current_frame_cnt = 0; |
|
|
|