Gameover Scene after animation/seconds

Hello.

If my player hit an enemy he plays an animation. And i want that the gameover-scene starts after this animation or after 2 seconds.

if i write in the function ‘‘this.scene.start(‘gameover’);’’ , it goes directly to the Gameover-scene without playing the animation. how can i do this?

this.anims.create({
key: ‘dead’,
frameRate: 15,
frames: this.anims.generateFrameNames(‘dead’,{start: 0, end: 9})
});

function hitenemy(player, kunai, star, fire){
this.physics.pause();
player.setTint(0xff0000);
player.play(‘dead’);
this.scene.start(‘gameover’);
}

You could use a timer

this.scene.time.addEvent({
    delay: 2000,
    callback: () => this.scene.start(‘gameover’)
)}