aboutsummaryrefslogtreecommitdiffstats
path: root/js/perso.js
diff options
context:
space:
mode:
authorpiernov <piernov@piernov.org>2016-05-08 14:40:02 +0200
committerpiernov <piernov@piernov.org>2016-05-08 14:40:02 +0200
commit2ecc9a72e9e932f1bf0431f391814837d8694884 (patch)
treeae5b94939d04a37a7952d9e65578eccdb8988971 /js/perso.js
parente46e058e34c030c4a5342e82dd24ac49104d56e9 (diff)
downloadcandybox-2ecc9a72e9e932f1bf0431f391814837d8694884.tar.gz
candybox-2ecc9a72e9e932f1bf0431f391814837d8694884.tar.bz2
candybox-2ecc9a72e9e932f1bf0431f391814837d8694884.tar.xz
candybox-2ecc9a72e9e932f1bf0431f391814837d8694884.zip
Create updatePerso() JS function
Diffstat (limited to 'js/perso.js')
-rw-r--r--js/perso.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/js/perso.js b/js/perso.js
index 365cf54..02a8892 100644
--- a/js/perso.js
+++ b/js/perso.js
@@ -3,3 +3,10 @@ function displayPerso(hp,xp,lv){
document.getElementById("lv").innerHTML = lv;
document.getElementById("xp").innerHTML = xp;
}
+
+function updatePerso(perso) {
+ data.hp = perso.hp;
+ data.xp = perso.xp;
+ data.level = perso.lv;
+ displayPerso(perso.hp, perso.xp, perso.lv);
+}