From 729def0e9236ebc9ae60ce4d9eccb4d9d6c7bab5 Mon Sep 17 00:00:00 2001 From: "gwenael.planchon" Date: Thu, 28 Mar 2024 09:31:06 +0100 Subject: [PATCH] ajouter animation incrementation points kahoot --- .../components/jeux/kahoot/KahootPartie.vue | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/science-quest/src/components/jeux/kahoot/KahootPartie.vue b/science-quest/src/components/jeux/kahoot/KahootPartie.vue index 1aab106..b25a792 100644 --- a/science-quest/src/components/jeux/kahoot/KahootPartie.vue +++ b/science-quest/src/components/jeux/kahoot/KahootPartie.vue @@ -35,8 +35,7 @@ export default { score:0, pointsGagne:0, }, - - DEBUG_temps:1000, + pointsAnimation:0 } }, mounted(){ @@ -82,10 +81,14 @@ export default { this.resetEtats() //cacher l'etat precedent Kahoot.obtenirScore().then(response=>{ this.tempsLimite=response.tempsLimite + this.score=response //afficher cet etat this.etats.score=true - this.score=response + //reduire les points pour pouvoir l'incrementer progressivement + this.pointsAnimation=this.score.score-this.score.pointsGagne + this.animerIncrementationPoints() + if(this.tempsLimite!=-1){ //executer la fonction en boucle jusqu'a ce que la partie se termine this.obtenirTimeoutId=window.setTimeout(this.choisirLeProchainEtat(),(this.tempsLimite+100)-Date.now()) @@ -126,10 +129,16 @@ export default { } this.compteARebours=((this.tempsLimite-Date.now())/1000).toFixed(KAHOOT_NB_APRES_LA_VIRGULE_COMPTE_A_REBOURS) }, - resetEtats(){ Object.keys(this.etats).forEach(nomEtat=>this.etats[nomEtat]=0) - } + }, + animerIncrementationPoints(){ + if(this.pointsAnimation{{ reponse }}
-

Votre score : {{ score.score }} (+{{ score.pointsGagne }})

+

Votre score : {{ pointsAnimation }} (+{{ score.pointsGagne }})

  1. {{ joueur }} : {{score.leaderboard[joueur]}}