12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- class AudioPlayer extends GameObject
- {
-
- constructor(name, p5Audio = null)
- {
- super(name);
- this.p5Audio = p5Audio;
- }
-
- setP5Audio(p5Audio)
- {
- if (this.p5Audio) this.p5Audio.stop();
- this.p5Audio = p5Audio;
- }
-
- getP5Audio()
- {
- return this.p5Audio;
- }
-
- play()
- {
- if (this.p5Audio) this.p5Audio.play();
- }
-
- stop()
- {
- if (this.p5Audio) this.p5Audio.stop();
- }
-
-
-
- autoplay()
- {
- if (this.p5Audio) this.p5Audio.autoplay(true);
- }
- }
|