Skip to content

Commit

Permalink
fix bug about scene audio visualizer beat position issue
Browse files Browse the repository at this point in the history
  • Loading branch information
izure1 committed Dec 19, 2021
1 parent dc13045 commit f03b68a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eriengine",
"version": "1.0.0-alpha.30",
"version": "1.0.0-alpha.31",
"private": true,
"scripts": {
"lint": "vue-cli-service lint",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export class PreviewAudioVisualizer extends Phaser.GameObjects.Text {
})
}

preUpdate() {
this.followBeat()
}

private createTween(): Phaser.Tweens.Tween {
return this.scene.tweens.addCounter({
from: 0,
Expand All @@ -46,6 +50,15 @@ export class PreviewAudioVisualizer extends Phaser.GameObjects.Text {
})
}

private followBeat(): void {
if (!this.beat) {
return
}
console.log(123)
const { x, y } = this
this.beat.setPosition(x, y)
}

private destroyBeat(): void {
if (!this.beat) {
return
Expand Down

0 comments on commit f03b68a

Please sign in to comment.