react-simple-game-engine 0.2.89 → 0.2.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ export declare class Sound {
4
4
  readonly type: SoundType;
5
5
  static Management: SoundManagement;
6
6
  readonly native: HTMLAudioElement;
7
+ private _volume;
7
8
  constructor(type?: SoundType);
8
9
  get volumn(): number;
9
10
  set volumn(vol: number);
@@ -1 +1 @@
1
- {"version":3,"file":"sound.d.ts","sourceRoot":"","sources":["../../src/classes/sound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,qBAAa,KAAK;aAWY,IAAI,EAAE,SAAS;IAV3C,MAAM,CAAC,UAAU,EAAE,eAAe,CAOhC;IACF,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAe;gBAEpB,IAAI,GAAE,SAA0B;IAE5D,IAAI,MAAM,IAIM,MAAM,CAFrB;IAED,IAAI,MAAM,CAAC,GAAG,EAAE,MAAM,EAErB;IAED,IAAI,SAAS,YAEZ;IAEK,OAAO;IAQP,KAAK;IAIL,MAAM;IAQN,IAAI;IAQJ,IAAI;CAYX"}
1
+ {"version":3,"file":"sound.d.ts","sourceRoot":"","sources":["../../src/classes/sound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,qBAAa,KAAK;aAYY,IAAI,EAAE,SAAS;IAX3C,MAAM,CAAC,UAAU,EAAE,eAAe,CAOhC;IACF,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAe;IAChD,OAAO,CAAC,OAAO,CAAS;gBAEI,IAAI,GAAE,SAA0B;IAE5D,IAAI,MAAM,IAIM,MAAM,CAFrB;IAED,IAAI,MAAM,CAAC,GAAG,EAAE,MAAM,EAGrB;IAED,IAAI,SAAS,YAEZ;IAEK,OAAO;IAQP,KAAK;IAIL,MAAM;IAQN,IAAI;IAQJ,IAAI;CAcX"}
@@ -48,6 +48,7 @@ var Sound = /** @class */ (function () {
48
48
  return this.native.volume;
49
49
  },
50
50
  set: function (vol) {
51
+ this._volume = vol;
51
52
  this.native.volume = vol;
52
53
  },
53
54
  enumerable: false,
@@ -120,7 +121,7 @@ var Sound = /** @class */ (function () {
120
121
  };
121
122
  Sound.prototype.play = function () {
122
123
  return __awaiter(this, void 0, void 0, function () {
123
- var canPlay, loop;
124
+ var canPlay, loop, exec;
124
125
  return __generator(this, function (_a) {
125
126
  switch (_a.label) {
126
127
  case 0:
@@ -133,7 +134,9 @@ var Sound = /** @class */ (function () {
133
134
  else {
134
135
  this.native.loop = false;
135
136
  }
136
- return [4 /*yield*/, this.native.play()];
137
+ exec = this.native.play();
138
+ this.native.volume = this._volume;
139
+ return [4 /*yield*/, exec];
137
140
  case 1:
138
141
  _a.sent();
139
142
  _a.label = 2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-simple-game-engine",
3
- "version": "0.2.89",
3
+ "version": "0.2.90",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib",