Browse Source

first commit

master
song 4 years ago
parent
commit
c175576845
  1. BIN
      public/恢复_太空机战_HTML5 Canvas.fla
  2. 4
      src/classes/main.js
  3. 4
      src/classes/sound.js

BIN
public/恢复_太空机战_HTML5 Canvas.fla

Binary file not shown.

4
src/classes/main.js

@ -45,11 +45,11 @@ Main.prototype.init = function () {
};
// play
// 限制了两次动作间隔时间不能少于2s
// 限制了两次动作间隔时间不能少于3.5s
// 游戏状态在进行中才能触发
// play次数 >= 最多完成次数 调用结束的callback
Main.prototype.play = function (direction) {
if (Date.now() - this.prevTime <= 1200 || state !== 1) return;
if (Date.now() - this.prevTime <= 3500 || state !== 1) return;
// if (state !== 1) return;
this.element.play();
if (direction === 99) return;

4
src/classes/sound.js

@ -32,8 +32,8 @@ Sound.prototype.init = function () {
};
Sound.prototype.playBgm = function () {
this.music.bgm && this.music.bgm.play({ loop: -1, volume: 0.5 }); // 播放背景音乐
this.music.audio2 && this.music.audio2.play({ loop: -1, volume: 0.2, playbackRate: 1.2 }); // 播放射击声
this.music.bgm && this.music.bgm.play({ loop: -1 }); // 播放背景音乐
this.music.audio2 && this.music.audio2.play({ loop: -1, volume: 0.1 }); // 播放射击声
};
Sound.prototype.playBomb = function (direction) {

Loading…
Cancel
Save