4 ms·
Merchant is used mainly to handle large amounts of number changes in a way that makes sense. In a lot of games (especially idle games), there's lots of differen
by flaque 9y ago
Merchant is used mainly to handle large amounts of number changes in a way that makes sense. In a lot of games (especially idle games), there's lots of different counters that should be updated all at once.
For example, you may have the amount of player gold and experience, but you also might have a number for every item in the game. Merchant is a pattern to deal with all of these in one fell swoop instead of having lots of separate functions that loosely relate to each other like:
```
updateGold();
updateSwordPower();
payForSwords();
...
```
So it could be used in gamification if you have lots of currencies and items, yes. But if you're doing something simple, you might be better off just doing it with regular javascript patterns.