Samarium Thanks again for help !!
Here for the exp bar :
<template>
<div class="exp-bar">
<div class="bar">
<div class="inner-exp-bar" :style="{ width }"></div>
</div>
</div>
</template>
<script>
export default {
name: 'exp',
inject: ['rpgCurrentPlayer'],
data() {
return {
exp: 0,
expForNextlevel: 0
}
},
mounted() {
this.obsCurrentPlayer = this.rpgCurrentPlayer
.subscribe(({ object }) => {
this.exp = object.exp
this.expForNextlevel = object.param.expForNextlevel
})
},
computed: {
width() {
**return ((this.exp / this.expForNextlevel) * 100) + '%'** => not working here
}
},
unmounted() {
this.obsCurrentPlayer.unsubscribe()
}
}
</script>
<style>
.exp-bar {
width: 200px;
margin-top: 10px;
margin-left: 10px;
background: rgba(0, 0, 0, 0.3)
}
.exp-bar p {
margin: 5px;
color: white;
font-size: 21px;
font-weight: bold;
}
.bar {
border: 2px solid black;
border-radius: 5px;
position: relative;
}
.inner-exp-bar {
background: rgb(30, 62, 168);
height: 10px;
position: relative;
transition: width .5s linear;
}
</style>
Here for the login (working but always the same map when the player change the map)
/module/index
import main from './main'
import defaultGui from '@rpgjs/default-gui'
//import mobileGui from '@rpgjs/mobile-gui'
//import gamepad from '@rpgjs/gamepad'
import displayName from './display-name'
import titleScreen from '@rpgjs/title-screen'
export default [
main,
defaultGui,
//mobileGui,
//gamepad,
displayName,
titleScreen
]
/config/server/index
export default {
mongodb: 'mongodb://localhost:27017/test',
startMap: 'simplemap'
}