In the game, the user earns coins and I have used the local storage plugin to store the number of coins earned by the player. These are then spent on different things in the game but when coins are spent and the player returns to the home screen which displays the number of coins they have, it goes back to the original value. So, basically, I cannot subtract from the coins which I need to do.
E.g. The user accumulates 200 coins and spends 100. The coins should then show 100 left but it still shows 200. I think it's because I'm setting the value of coins to LocalStorage.ItemValue so it's pulling the previous value and ignoring the subtraction.
Any ideas how this can be solved?