react-simple-game-engine 0.2.90 → 0.2.92

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.
@@ -82,7 +82,7 @@ export declare abstract class Scene<UIP = any> {
82
82
  })[]): Promise<import("p5").Image[]>;
83
83
  createSounds(...srcables: (string | {
84
84
  src: string;
85
- volumn?: number;
85
+ volume?: number;
86
86
  type?: SoundType;
87
87
  })[]): Promise<Sound[]>;
88
88
  mapSprites(...srcs: string[]): Promise<void>;
@@ -290,8 +290,8 @@ var Scene = /** @class */ (function () {
290
290
  return [4 /*yield*/, createAssetSound(decor.src, decor.type)];
291
291
  case 2:
292
292
  sound = _b.sent();
293
- if (decor.volumn) {
294
- sound.volumn = decor.volumn;
293
+ if (decor.volume) {
294
+ sound.volume = decor.volume;
295
295
  }
296
296
  this[decor.propertyKey] = sound;
297
297
  this.sounds.push(sound);
@@ -331,7 +331,7 @@ var Scene = /** @class */ (function () {
331
331
  srcables[_i] = arguments[_i];
332
332
  }
333
333
  return __awaiter(this, void 0, void 0, function () {
334
- var sounds, _a, srcables_1, srcable, _b, volumn, src, _c, type, sound;
334
+ var sounds, _a, srcables_1, srcable, _b, volume, src, _c, type, sound;
335
335
  return __generator(this, function (_d) {
336
336
  switch (_d.label) {
337
337
  case 0:
@@ -342,13 +342,13 @@ var Scene = /** @class */ (function () {
342
342
  if (!(_a < srcables_1.length)) return [3 /*break*/, 4];
343
343
  srcable = srcables_1[_a];
344
344
  _b = typeof srcable === "string"
345
- ? { src: srcable, volumn: undefined, type: undefined }
346
- : srcable, volumn = _b.volumn, src = _b.src, _c = _b.type, type = _c === void 0 ? SoundType.ONCE : _c;
345
+ ? { src: srcable, volume: undefined, type: undefined }
346
+ : srcable, volume = _b.volume, src = _b.src, _c = _b.type, type = _c === void 0 ? SoundType.ONCE : _c;
347
347
  return [4 /*yield*/, createAssetSound(src, type)];
348
348
  case 2:
349
349
  sound = _d.sent();
350
- if (volumn) {
351
- sound.volumn = volumn;
350
+ if (volume) {
351
+ sound.volume = volume;
352
352
  }
353
353
  sounds.push(sound);
354
354
  this.sounds.push(sound);
@@ -421,8 +421,8 @@ var Scene = /** @class */ (function () {
421
421
  return [4 /*yield*/, createAssetSound(src, decor.type)];
422
422
  case 2:
423
423
  sound = _b.sent();
424
- if (decor.volumn) {
425
- sound.volumn = decor.volumn;
424
+ if (decor.volume) {
425
+ sound.volume = decor.volume;
426
426
  }
427
427
  this[decor.propertyKey] = sound;
428
428
  this.sounds.push(sound);
@@ -4,10 +4,9 @@ export declare class Sound {
4
4
  readonly type: SoundType;
5
5
  static Management: SoundManagement;
6
6
  readonly native: HTMLAudioElement;
7
- private _volume;
8
7
  constructor(type?: SoundType);
9
- get volumn(): number;
10
- set volumn(vol: number);
8
+ get volume(): number;
9
+ set volume(vol: number);
11
10
  get isStopped(): boolean;
12
11
  playNow(): Promise<void>;
13
12
  pause(): Promise<void>;
@@ -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;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"}
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"}
@@ -43,12 +43,11 @@ var Sound = /** @class */ (function () {
43
43
  this.type = type;
44
44
  this.native = new Audio();
45
45
  }
46
- Object.defineProperty(Sound.prototype, "volumn", {
46
+ Object.defineProperty(Sound.prototype, "volume", {
47
47
  get: function () {
48
48
  return this.native.volume;
49
49
  },
50
50
  set: function (vol) {
51
- this._volume = vol;
52
51
  this.native.volume = vol;
53
52
  },
54
53
  enumerable: false,
@@ -121,7 +120,7 @@ var Sound = /** @class */ (function () {
121
120
  };
122
121
  Sound.prototype.play = function () {
123
122
  return __awaiter(this, void 0, void 0, function () {
124
- var canPlay, loop, exec;
123
+ var canPlay, loop;
125
124
  return __generator(this, function (_a) {
126
125
  switch (_a.label) {
127
126
  case 0:
@@ -134,9 +133,7 @@ var Sound = /** @class */ (function () {
134
133
  else {
135
134
  this.native.loop = false;
136
135
  }
137
- exec = this.native.play();
138
- this.native.volume = this._volume;
139
- return [4 /*yield*/, exec];
136
+ return [4 /*yield*/, this.native.play()];
140
137
  case 1:
141
138
  _a.sent();
142
139
  _a.label = 2;
@@ -1,6 +1,6 @@
1
1
  import { SoundType } from "../export-enums";
2
2
  export declare function SoundFrom(srcable?: string | {
3
3
  src?: string;
4
- volumn?: number;
4
+ volume?: number;
5
5
  }, type?: SoundType): (target: any, propertyKey: string) => void;
6
6
  //# sourceMappingURL=sound-from.decor.d.ts.map
@@ -4,14 +4,14 @@ export function SoundFrom(srcable, type) {
4
4
  return function (target, propertyKey) {
5
5
  var _a = srcable
6
6
  ? typeof srcable === "string"
7
- ? { src: srcable, volumn: undefined }
7
+ ? { src: srcable, volume: undefined }
8
8
  : srcable
9
- : { volumn: undefined, src: undefined }, volumn = _a.volumn, src = _a.src;
9
+ : { volume: undefined, src: undefined }, volume = _a.volume, src = _a.src;
10
10
  if (!target.soundsDecor) {
11
11
  target.soundsDecor = [];
12
12
  }
13
13
  target.soundsDecor.push({
14
- volumn: volumn,
14
+ volume: volume,
15
15
  propertyKey: propertyKey,
16
16
  src: src,
17
17
  type: type,
@@ -42,7 +42,7 @@ export declare type SoundDecor = {
42
42
  propertyKey: string;
43
43
  src?: string;
44
44
  type: SoundType;
45
- volumn?: number;
45
+ volume?: number;
46
46
  };
47
47
  export declare type SpriteDecor = {
48
48
  propertyKey: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-simple-game-engine",
3
- "version": "0.2.90",
3
+ "version": "0.2.92",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib",