When the hint shop scammed the player


During Development of the shop that sold hints to the key item locations, if the player closed and re-opened the shop and tried to buy something, the shop would try to sell the player that hint multiple times even though you can only buy it once. After trying to debug it, we found that the shop would run the buy item function multiple times due to the buy button being bound to the function multiple times when the shop menu closes and opens again.

After trying multiple things including removing the bind when the shop closes, I remembered that there was a function to completely delete the shop UI and then recreate it when it needs to be opened. Before, we just removed the shop UI from view and would bring it back into view when the shop opens. When I made this change, I had to put in some measures to make sure things are accurate. Specifically, checking if the player has bought an item or not and updating the shop to show its sold out when the player opens the shop.

Leave a comment

Log in with itch.io to leave a comment.