Skip to content

Commit

Permalink
fix(loop): stop playing when record button is clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
domi7777 committed Oct 6, 2024
1 parent 555290d commit effe40a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/scenes/DrumsScene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,10 @@ export class DrumsScene extends Phaser.Scene {
record.button.setInteractive()
.on('pointerdown', () => {
if (this.controls.state === 'idle' || this.controls.state === 'playing') {
stopPlaying();
this.controls.state = 'readyToRecord';
record.text.setText('Hit a pad to start');
} else if (this.controls.state === 'readyToRecord') {
this.controls.state = 'idle';
record.text.setText(record.text.getData('initial'));
} else if (this.controls.state === 'recording') {
this.controls.state = 'idle';
stopRecording();
Expand Down

0 comments on commit effe40a

Please sign in to comment.